patch 8.0.0948: crash if timer closes window while dragging status line
Problem: Crash if timer closes window while dragging status line.
Solution: Check if the window still exists. (Yasuhiro Matsumoto, closes
#1979)
diff --git a/src/gui.c b/src/gui.c
index 63625bf..f774750 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4933,7 +4933,7 @@
}
/*
- * 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 @@
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)
{