aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 9f07f2bddc..9c56cc5b82 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1766,7 +1766,7 @@ static int close_last_window_tabpage(win_T *win, int free_buf, tabpage_T *prev_c
}
buf_T *old_curbuf = curbuf;
- Terminal *term = win->w_buffer->terminal;
+ Terminal *term = win->w_buffer ? win->w_buffer->terminal : NULL;
if (term) {
// Don't free terminal buffers
free_buf = false;