Check whether the agentview files exist before trying to read them.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 4 Sep 2010 12:35:09 +0000 (14:35 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 4 Sep 2010 12:35:09 +0000 (14:35 +0200)
lisp/ChangeLog
lisp/gnus-agent.el

index 4c21106..f8e4902 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-agent.el (gnus-agent-load-alist): Check whether the agentview
+       files exist before trying to read them.
+
        * gnus-html.el (gnus-html-wash-tags): Remove even more white space
        around <pre_int>.
 
index 96a62e6..c523281 100644 (file)
@@ -2108,13 +2108,15 @@ doesn't exist, to valid the overview buffer."
 (defun gnus-agent-load-alist (group)
   "Load the article-state alist for GROUP."
   ;; Bind free variable that's used in `gnus-agent-read-agentview'.
-  (let ((gnus-agent-read-agentview group)
-       (file-name-coding-system nnmail-pathname-coding-system))
-    (setq gnus-agent-article-alist
-          (gnus-cache-file-contents
-           (gnus-agent-article-name ".agentview" group)
-           'gnus-agent-file-loading-cache
-           'gnus-agent-read-agentview))))
+  (let* ((gnus-agent-read-agentview group)
+        (file-name-coding-system nnmail-pathname-coding-system)
+        (agentview (gnus-agent-article-name ".agentview" group)))
+    (when (file-exists-p agentview)
+      (setq gnus-agent-article-alist
+           (gnus-cache-file-contents
+            agentview
+            'gnus-agent-file-loading-cache
+            'gnus-agent-read-agentview)))))
 
 (defun gnus-agent-read-agentview (file)
   "Load FILE and do a `read' there."