]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't manipulate gnus-newsrc-alist if it hasn't been initalized
authorEric Abrahamsen <eric@ericabrahamsen.net>
Thu, 3 Oct 2019 23:21:02 +0000 (16:21 -0700)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Fri, 4 Oct 2019 22:14:28 +0000 (15:14 -0700)
* lisp/gnus/gnus-group.el (gnus-group-set-info): Packages that use
Gnus summary mode without actually booting Gnus might end up in this
situation. See bug#36903

lisp/gnus/gnus-group.el

index 915125b655c27b194294a14e8a3cd7eb0d77b180..742f8f4be56d6b72782e0988cbf060a519683819 100644 (file)
@@ -4465,12 +4465,14 @@ and the second element is the address."
              (setcar entry (length
                             (gnus-list-of-unread-articles (car info)))))
            ;; The above `setcar' will only affect the hashtable, not
-           ;; the alist: update the alist separately.
-           (push info (cdr (setq gnus-newsrc-alist
-                                  (remove (assoc-string
-                                           (gnus-info-group info)
-                                           gnus-newsrc-alist)
-                                          gnus-newsrc-alist)))))
+           ;; the alist: update the alist separately, but only if
+           ;; it's been initialized.
+           (when gnus-newsrc-alist
+             (push info (cdr (setq gnus-newsrc-alist
+                                   (remove (assoc-string
+                                            (gnus-info-group info)
+                                            gnus-newsrc-alist)
+                                           gnus-newsrc-alist))))))
        (error "No such group: %s" (gnus-info-group info))))))
 
 ;; Ad-hoc function for inserting data from a different newsrc.eld