diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-30 15:53:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-30 15:53:29 +0200 |
commit | 5c3fb04623d0260762f1c3c1ba250a407098ff2a (patch) | |
tree | 00b78d9fe8aa3a83b23f12f8211ee48ea8ccc039 /src/popupmnu.c | |
parent | cacc6a5c986fbc716bf53b6916f076dd7b388142 (diff) | |
download | vim-git-5c3fb04623d0260762f1c3c1ba250a407098ff2a.tar.gz |
patch 8.1.1424: crash when popup menu is deleted while waiting for charv8.1.1424
Problem: Crash when popup menu is deleted while waiting for char.
Solution: Bail out when pum_array was cleared.
Diffstat (limited to 'src/popupmnu.c')
-rw-r--r-- | src/popupmnu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c index 9ebf6b7a6..276d49fd0 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -1302,7 +1302,10 @@ pum_show_popupmenu(vimmenu_T *menu) out_flush(); c = vgetc(); - if (c == ESC || c == Ctrl_C) + + // Bail out when typing Esc, CTRL-C or some callback closed the popup + // menu. + if (c == ESC || c == Ctrl_C || pum_array == NULL) break; else if (c == CAR || c == NL) { |