branch: externals/modus-themes
commit ed618c10501aa2602477cef31c159cefe79e19fe
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Add two error checks for the type of modus-themes-generate-palette arguments
---
 modus-themes.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modus-themes.el b/modus-themes.el
index 2ed0eb06d4..ec2eab9a70 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -7597,6 +7597,16 @@ COOL-OR-WARM-PREFERENCE.
 
 With optional MAPPINGS use them instead of trying to derive new ones."
   (require 'color)
+  (when (seq-some
+           (lambda (entry)
+             (not (stringp (cdr entry))))
+           base-colors)
+    (error "Base colors can only be references to string color values, not 
symbols"))
+  (when (seq-some
+           (lambda (entry)
+             (stringp (cdr entry)))
+           mappings)
+    (error "Mappings can only be references to named colors, not color 
values"))
   (let ((bg-main (alist-get 'bg-main base-colors))
         (fg-main (alist-get 'fg-main base-colors)))
     (unless (and bg-main fg-main)

Reply via email to