summaryrefslogtreecommitdiff
path: root/src/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/list.c b/src/list.c
index 866de1871..b62c14164 100644
--- a/src/list.c
+++ b/src/list.c
@@ -2185,8 +2185,13 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap)
nli = li->li_next;
set_vim_var_nr(VV_KEY, idx);
if (filter_map_one(&li->li_tv, expr, filtermap,
- &newtv, &rem) == FAIL || did_emsg)
+ &newtv, &rem) == FAIL)
break;
+ if (did_emsg)
+ {
+ clear_tv(&newtv);
+ break;
+ }
if (filtermap == FILTERMAP_MAP)
{
// map(): replace the list item value