From 843dc435f797e6804663ae074d3d88993c4cd8a4 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 19 Apr 2022 13:42:17 +0200 Subject: [PATCH] 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). --- lisp/gnus/mml.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.2