summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index 66dd099bf..78ce4d235 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5256,10 +5256,13 @@ win_unlisted(win_T *wp)
void
win_free_popup(win_T *win)
{
- if (bt_popup(win->w_buffer))
- win_close_buffer(win, DOBUF_WIPE_REUSE, FALSE);
- else
- close_buffer(win, win->w_buffer, 0, FALSE, FALSE);
+ if (win->w_buffer != NULL)
+ {
+ if (bt_popup(win->w_buffer))
+ win_close_buffer(win, DOBUF_WIPE_REUSE, FALSE);
+ else
+ close_buffer(win, win->w_buffer, 0, FALSE, FALSE);
+ }
# if defined(FEAT_TIMERS)
if (win->w_popup_timer != NULL)
stop_timer(win->w_popup_timer);