>From fc0ee63bb0cadb054260ea74d310720ac3068f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= Date: Sat, 1 Dec 2018 01:20:45 +0100 Subject: [PATCH] Check that feature exist in `sql-set-product-feature' (Bug#30494). * lisp/progmodes/sql.el: add check for feature existence. --- lisp/progmodes/sql.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index e7d7494d2c..9051a6ad07 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -2533,13 +2533,17 @@ sql-set-product-feature (let* ((p (assoc product sql-product-alist)) (v (plist-get (cdr p) feature))) - (if p + (if (and p v) (if (and (member feature sql-indirect-features) (symbolp v)) (set v newvalue) (setcdr p (plist-put (cdr p) feature newvalue))) - (error "`%s' is not a known product; use `sql-add-product' to add it first." product)))) + (progn + (when (null p) + (error "`%s' is not a known product; use `sql-add-product' to add it first." product)) + (when (null v) + (error "`%s' is not a known feature for `%s'; use `sql-add-product' to add it first." feature product)))))) (defun sql-get-product-feature (product feature &optional fallback not-indirect) "Lookup FEATURE associated with a SQL PRODUCT. -- 2.19.2