]> git.eshelyaron.com Git - emacs.git/commitdiff
; Don't set nil to be a face fore-/background
authorPhilip Kaludercic <philip@icterid>
Mon, 19 Sep 2022 19:17:09 +0000 (21:17 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Tue, 20 Sep 2022 17:25:39 +0000 (19:25 +0200)
* lisp/net/rcirc.el (rcirc-color-attributes): Check if the parsed
background or foreground is nil before using it.

lisp/net/rcirc.el

index 5e48b3c70f28015301f886ba69818a29f3346615..eb3b48da6eefc83056a1565741bb2fb040494c02 100644 (file)
@@ -3042,10 +3042,8 @@ indicated by RESPONSE)."
                  ((<= 0 bg (1- (length rcirc-color-codes)))))
         (setq background (aref rcirc-color-codes bg)))
       (rcirc-add-face (match-beginning 0) (match-end 0)
-                      `(face (:foreground
-                              ,foreground
-                              :background
-                              ,background))))))
+                      `(face (,@(and foreground (list :foreground foreground))
+                              ,@(and background (list :background background))))))))
 
 (defun rcirc-remove-markup-codes (_sender _response)
   "Remove ASCII control codes used to designate markup."