patch 8.0.0853: crash when running terminal with unknown command
Problem: Crash when running terminal with unknown command.
Solution: Check "term" not to be NULL. (Yasuhiro Matsumoto, closes #1932)
diff --git a/src/terminal.c b/src/terminal.c
index abdb50b..b06feff 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -629,7 +629,8 @@
{
/* Also consider the job finished when the channel is closed, to avoid a
* race condition when updating the title. */
- return term->tl_job != NULL
+ return term != NULL
+ && term->tl_job != NULL
&& term->tl_job->jv_status == JOB_STARTED
&& channel_is_open(term->tl_job->jv_channel);
}