diff options
Diffstat (limited to 'src/dict.c')
-rw-r--r-- | src/dict.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dict.c b/src/dict.c index 9ce6dda3d2..dca0b9f929 100644 --- a/src/dict.c +++ b/src/dict.c @@ -1209,11 +1209,12 @@ dict_list(typval_T *argvars, typval_T *rettv, int what) emsg(_(e_dictreq)); return; } - if ((d = argvars[0].vval.v_dict) == NULL) - return; if (rettv_list_alloc(rettv) == FAIL) return; + if ((d = argvars[0].vval.v_dict) == NULL) + // empty dict behaves like an empty dict + return; todo = (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) |