summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-16 22:46:01 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-16 22:46:01 +0200
commit989a70c590c2bd109eb362d3a0e48cb1427ae13d (patch)
treee35f05c19c3589b00450a54c40d3d928b32b0500 /src/gui.c
parent6fe15bbc87cb996912fe3c2c4068e356071ac516 (diff)
patch 8.0.0948: crash if timer closes window while dragging status linev8.0.0948
Problem: Crash if timer closes window while dragging status line. Solution: Check if the window still exists. (Yasuhiro Matsumoto, closes #1979)
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui.c b/src/gui.c
index 63625bfc40..f774750f2b 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4933,7 +4933,7 @@ gui_mouse_correct(void)
}
/*
- * Find window where the mouse pointer "y" coordinate is in.
+ * Find window where the mouse pointer "x" / "y" coordinate is in.
*/
static win_T *
xy2win(int x UNUSED, int y UNUSED)
@@ -4948,6 +4948,8 @@ xy2win(int x UNUSED, int y UNUSED)
if (row < 0 || col < 0) /* before first window */
return NULL;
wp = mouse_find_win(&row, &col);
+ if (wp == NULL)
+ return NULL;
# ifdef FEAT_MOUSESHAPE
if (State == HITRETURN || State == ASKMORE)
{