]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/bindings.el (bound-and-true-p): Verify argument is a symbol
authorJuanma Barranquero <lekktu@gmail.com>
Sat, 3 Dec 2022 01:04:48 +0000 (02:04 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Sat, 3 Dec 2022 01:04:48 +0000 (02:04 +0100)
lisp/bindings.el

index c1ad5f7520e6eb0289e4db84d955b81cf449a767..a3f51ebb3150892248c8b8530123735b4ea960f6 100644 (file)
@@ -670,6 +670,8 @@ or not."
   "Return the value of symbol VAR if it is bound, else nil.
 Note that if `lexical-binding' is in effect, this function isn't
 meaningful if it refers to a lexically bound variable."
+  (unless (symbolp var)
+    (signal 'wrong-type-argument (list 'symbolp var)))
   `(and (boundp (quote ,var)) ,var))
 
 ;; Use mode-line-mode-menu for local minor-modes only.