summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 8238b6ec..cc9e8788 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -21371,6 +21371,7 @@ find_var_in_ht(ht, htname, varname, no_autoload)
/*
* Find the hashtab used for a variable name.
+ * Return NULL if the name is not valid.
* Set "varname" to the start of name without ':'.
*/
static hashtab_T *
@@ -21380,6 +21381,8 @@ find_var_ht(name, varname)
{
hashitem_T *hi;
+ if (name[0] == NUL)
+ return NULL;
if (name[1] != ':')
{
/* The name must not start with a colon or #. */