Not all articles have bodies. Protect against this.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 11 Oct 2010 18:30:46 +0000 (20:30 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 11 Oct 2010 18:30:46 +0000 (20:30 +0200)
Reported by Michael Welsh Duggan.

lisp/ChangeLog
lisp/nnimap.el

index 8aeff44..f798f08 100644 (file)
@@ -1,5 +1,8 @@
 2010-10-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 2010-10-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-transform-split-mail): Not all articles have
+       bodies.  Protect against this.  Reported by Michael Welsh Duggan.
+
        * shr.el (shr-current-column): New function.
        (shr-find-fill-point): New function.
 
        * shr.el (shr-current-column): New function.
        (shr-find-fill-point): New function.
 
index 73b7fbd..68bd630 100644 (file)
@@ -1627,8 +1627,10 @@ textual parts.")
        (forward-char (1+ bytes))
        (setq bytes (nnimap-get-length))
        (delete-region (line-beginning-position) (line-end-position))
        (forward-char (1+ bytes))
        (setq bytes (nnimap-get-length))
        (delete-region (line-beginning-position) (line-end-position))
-       (forward-char (1+ bytes))
-       (delete-region (line-beginning-position) (line-end-position))))))
+       ;; There's a body; skip past that.
+       (when bytes
+         (forward-char (1+ bytes))
+         (delete-region (line-beginning-position) (line-end-position)))))))
 
 (defun nnimap-dummy-active-number (group &optional server)
   1)
 
 (defun nnimap-dummy-active-number (group &optional server)
   1)