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).
This commit is contained in:
Lars Ingebrigtsen 2022-04-19 13:42:17 +02:00
parent 5df658a96a
commit 843dc435f7

View file

@ -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