diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 982074f62a..39e121eb53 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2621,9 +2621,12 @@ void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip) *errp = FALSE; if (!skip) { l = tv.vval.v_list; - if (tv.v_type != VAR_LIST || l == NULL) { + if (tv.v_type != VAR_LIST) { EMSG(_(e_listreq)); clear_tv(&tv); + } else if (l == NULL) { + // a null list is like an empty list: do nothing + clear_tv(&tv); } else { /* No need to increment the refcount, it's already set for the * list being used in "tv". */ |