From 2f1b84a0f3fb9e765530878e08a25d3194a831bb Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 24 Jul 2018 21:12:24 +1000 Subject: [PATCH] Fix crash when clicking certain surfaces cont was NULL. --- sway/input/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 8a6299cf..27597640 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -570,7 +570,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); // Handle mouse bindings - bool on_border = find_resize_edge(cont, cursor) != WLR_EDGE_NONE; + bool on_border = cont && (find_resize_edge(cont, cursor) != WLR_EDGE_NONE); bool on_contents = !on_border && surface; bool on_titlebar = !on_border && !surface; struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(cursor->seat->wlr_seat);