The shell_grab_start function sets up a destroy notification on the
shell surface such that when the shell surface is destroyed the pointer
on the grab to the shell surface is set to NULL.
We must therefore check whether the shell surface is NULL and end the
grab if it is.
https://bugs.freedesktop.org/show_bug.cgi?id=64689
pointer->x, pointer->y,
&sx, &sy);
- if (grab->shsurf->surface != surface) {
+ if (!grab->shsurf || grab->shsurf->surface != surface) {
shell_grab_end(grab);
free(grab);
}