0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1985: crash when closing terminal popup with <Cmd> mapping

Problem:    Crash when closing terminal popup with <Cmd> mapping.
Solution:   Check b_term is not NULL. (closes #7294)
This commit is contained in:
Bram Moolenaar
2020-11-14 20:21:55 +01:00
parent 33aecb1f2c
commit 02764713a7
3 changed files with 15 additions and 3 deletions

View File

@@ -2527,7 +2527,7 @@ terminal_loop(int blocking)
while (blocking || vpeekc_nomap() != NUL)
{
#ifdef FEAT_GUI
if (!curbuf->b_term->tl_system)
if (curbuf->b_term != NULL && !curbuf->b_term->tl_system)
#endif
// TODO: skip screen update when handling a sequence of keys.
// Repeat redrawing in case a message is received while redrawing.
@@ -2542,8 +2542,6 @@ terminal_loop(int blocking)
restore_cursor = TRUE;
raw_c = term_vgetc();
if (raw_c > 0)
ch_log(NULL, "terminal_loop() got %d", raw_c);
if (!term_use_loop_check(TRUE) || in_terminal_loop != curbuf->b_term)
{
// Job finished while waiting for a character. Push back the