nnmail.el (nnmail-cache-insert): protect from nil message IDs,
authorTeodor Zlatanov <tzz@lifelogs.com>
Mon, 27 Oct 2003 14:51:10 +0000 (14:51 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Mon, 27 Oct 2003 14:51:10 +0000 (14:51 +0000)
but should we do something else?

gnus-registry.el (gnus-registry-spool-action): protect from nil
message IDs

lisp/ChangeLog
lisp/gnus-registry.el
lisp/nnmail.el

index fc386d1..922c4b1 100644 (file)
@@ -1,3 +1,11 @@
+2003-10-27  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * nnmail.el (nnmail-cache-insert): protect from nil message IDs,
+       but should we do something else?
+
+       * gnus-registry.el (gnus-registry-spool-action): protect from nil
+       message IDs
+
 2003-10-26  Simon Josefsson  <jas@extundo.com>
 
        * gnus-art.el (gnus-button-alist): Allow & in mailto URLs.
index e3b9177..ec14c53 100644 (file)
@@ -324,7 +324,7 @@ tracked this way."
   ;; do not process the draft IDs
 ;  (unless (string-match "totally-fudged-out-message-id" id)
 ;    (let ((group (gnus-group-guess-full-name group)))
-  (when (string-match "\r$" id)
+  (when (and (stringp id) (string-match "\r$" id))
     (setq id (substring id 0 -1)))
   (gnus-message 5 "Registry: article %s spooled to %s"
                id
index de4a4b0..7b06ec4 100644 (file)
@@ -1496,30 +1496,31 @@ See the documentation for the variable `nnmail-split-fancy' for details."
 (defvar group-art-list)
 (defvar group-art)
 (defun nnmail-cache-insert (id grp &optional subject)
-  (run-hook-with-args 'nnmail-spool-hook 
-                     id grp subject)
-  (when nnmail-treat-duplicates
-    ;; Store some information about the group this message is written
-    ;; to.  This is passed in as the grp argument -- all locations this
-    ;; has been called from have been checked and the group is available.
-    ;; The only ambiguous case is nnmail-check-duplication which will only
-    ;; pass the first (of possibly >1) group which matches. -Josh
-    (unless (gnus-buffer-live-p nnmail-cache-buffer)
-      (nnmail-cache-open))
-    (save-excursion
-      (set-buffer nnmail-cache-buffer)
-      (goto-char (point-max))
-      (if (and grp (not (string= "" grp))
-              (gnus-methods-equal-p gnus-command-method
-                                    (nnmail-cache-primary-mail-backend)))
-         (let ((regexp (if (consp nnmail-cache-ignore-groups)
-                           (mapconcat 'identity nnmail-cache-ignore-groups
-                                      "\\|")
-                         nnmail-cache-ignore-groups)))
-           (unless (and regexp (string-match regexp grp))
-             (insert id "\t" grp "\n")))
-       (insert id "\n")))))
-
+  (when (stringp id)
+    (run-hook-with-args 'nnmail-spool-hook 
+                       id grp subject)
+    (when nnmail-treat-duplicates
+      ;; Store some information about the group this message is written
+      ;; to.  This is passed in as the grp argument -- all locations this
+      ;; has been called from have been checked and the group is available.
+      ;; The only ambiguous case is nnmail-check-duplication which will only
+      ;; pass the first (of possibly >1) group which matches. -Josh
+      (unless (gnus-buffer-live-p nnmail-cache-buffer)
+       (nnmail-cache-open))
+      (save-excursion
+       (set-buffer nnmail-cache-buffer)
+       (goto-char (point-max))
+       (if (and grp (not (string= "" grp))
+                (gnus-methods-equal-p gnus-command-method
+                                      (nnmail-cache-primary-mail-backend)))
+           (let ((regexp (if (consp nnmail-cache-ignore-groups)
+                             (mapconcat 'identity nnmail-cache-ignore-groups
+                                        "\\|")
+                           nnmail-cache-ignore-groups)))
+             (unless (and regexp (string-match regexp grp))
+               (insert id "\t" grp "\n")))
+         (insert id "\n"))))))
+  
 (defun nnmail-cache-primary-mail-backend ()
   (let ((be-list (cons gnus-select-method gnus-secondary-select-methods))
        (be nil)