summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-19 13:42:17 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-19 13:42:25 +0200
commit843dc435f797e6804663ae074d3d88993c4cd8a4 (patch)
tree1dfb75be2cb443f81e5d10c9cba7cfcc8d24350e
parent5df658a96a4bc7f8f96e3b2bf58dad32f81ce06a (diff)
downloademacs-843dc435f797e6804663ae074d3d88993c4cd8a4.tar.gz
Be more resilient against invalid headers in mml-generate-mime
* lisp/gnus/mml.el (mml-generate-mime): Don't bug out when called with invalid headers (bug#55014).
-rw-r--r--lisp/gnus/mml.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 5a526025061..093e582ea7a 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -500,7 +500,8 @@ type detected."
(when (and (consp (car cont))
(= (length cont) 1)
content-type)
- (setcdr (assq 'type (cdr (car cont))) content-type))
+ (when-let ((spec (assq 'type (cdr (car cont)))))
+ (setcdr spec content-type)))
(when (fboundp 'libxml-parse-html-region)
(setq cont (mapcar #'mml-expand-all-html-into-multipart-related cont)))
(prog1