diff src/terminal.c @ 22876:b952e0a3af2f v8.2.1985

patch 8.2.1985: crash when closing terminal popup with <Cmd> mapping Commit: https://github.com/vim/vim/commit/02764713a715c55e316e2bef5c9ade2fb767ee78 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 14 20:21:55 2020 +0100 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 https://github.com/vim/vim/issues/7294)
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Nov 2020 20:30:03 +0100
parents b825d8ec9a76
children 38324d4f1c94
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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