summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/gnus-art.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 3f384c65ece..ce0ff2ee8c0 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5058,11 +5058,14 @@ and `gnus-mime-delete-part', and not provided at run-time normally."
(gnus-article-edit-done))
(gnus-configure-windows 'article)
(sit-for 0)
- (when (and current-id (integerp gnus-auto-select-part))
- (gnus-article-jump-to-part
- (min (max (+ current-id gnus-auto-select-part) 1)
- (with-current-buffer gnus-article-buffer
- (length gnus-article-mime-handle-alist)))))))
+ (let ((handles (with-current-buffer gnus-article-buffer
+ gnus-article-mime-handle-alist)))
+ ;; `handles' will be nil if there is the only one part
+ ;; in the article and is deleted.
+ (when (and handles current-id (integerp gnus-auto-select-part))
+ (gnus-article-jump-to-part
+ (min (max (+ current-id gnus-auto-select-part) 1)
+ (length handles)))))))
(defun gnus-mime-replace-part (file)
"Replace MIME part under point with an external body."