(nnimap-credentials): Protect against auth-source-search returning nil.
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 18 Feb 2011 00:22:48 +0000 (16:22 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 18 Feb 2011 00:25:27 +0000 (16:25 -0800)
lisp/ChangeLog
lisp/nnimap.el

index 3b4f571..f8e9364 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-18  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-log-command): Add a newline to the inhibited
+       logging.
+       (nnimap-credentials): Protect against auth-source-search returning nil.
+
 2011-02-17  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * auth-source.el (auth-source-search): Do a two-phase search, one with
index 7f8ecc1..84bbac1 100644 (file)
@@ -277,15 +277,16 @@ textual parts.")
     (current-buffer)))
 
 (defun nnimap-credentials (address ports)
-  (let* ((found (nth 0 (auth-source-search :max 1
-                                           :host address
-                                           :port ports
-                                           :create t)))
-         (user (plist-get found :user))
-         (secret (plist-get found :secret))
-         (secret (if (functionp secret) (funcall secret) secret)))
+  (let ((found (nth 0 (auth-source-search :max 1
+                                         :host address
+                                         :port ports
+                                         :create t))))
     (if found
-        (list user secret)
+        (list (plist-get found :user)
+             (let ((secret (plist-get found :secret)))
+               (if (functionp secret)
+                   (funcall secret)
+                 secret)))
       nil)))
 
 (defun nnimap-keepalive ()
@@ -1588,7 +1589,7 @@ textual parts.")
     (goto-char (point-max))
     (insert (format-time-string "%H:%M:%S") " "
            (if nnimap-inhibit-logging
-               "(inhibited)"
+               "(inhibited)\n"
              command)))
   command)