]> git.eshelyaron.com Git - emacs.git/commitdiff
Make article--check-suspicious-addresses more resilient
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jan 2022 18:44:29 +0000 (19:44 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jan 2022 18:44:29 +0000 (19:44 +0100)
* lisp/gnus/gnus-art.el (article--check-suspicious-addresses):
Don't bug out on mbox-less addresses.

lisp/gnus/gnus-art.el

index 7611cef3e6887072575032b7d94d236e128a4d1f..d465dbfd5793b05d5fe4706d9e9eb7bd813325e5 100644 (file)
@@ -2659,12 +2659,12 @@ If PROMPT (the prefix), prompt for a coding system to use."
 (defun article--check-suspicious-addresses (addresses)
   (setq addresses (replace-regexp-in-string "\\`[^:]+:[ \t\n]*" "" addresses))
   (dolist (header (mail-header-parse-addresses addresses t))
-    (let ((address (car (mail-header-parse-address header))))
-      (when-let ((warning (textsec-check address 'email-address)))
-        (goto-char (point-min))
-        (while (search-forward address nil t)
-          (put-text-property (match-beginning 0) (match-end 0)
-                             'textsec-suspicious warning))))))
+    (when-let* ((address (car (mail-header-parse-address header)))
+                (warning (textsec-check address 'email-address)))
+      (goto-char (point-min))
+      (while (search-forward address nil t)
+        (put-text-property (match-beginning 0) (match-end 0)
+                           'textsec-suspicious warning)))))
 
 (defun article-decode-group-name ()
   "Decode group names in Newsgroups, Followup-To and Xref headers."