From 9be76e6b1272120dd5f9ae7aab400bf0479328ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= <antonin.decimo@gmail.com>
Date: Wed, 7 Aug 2019 16:02:07 +0200
Subject: [PATCH] input: check pointer against nullptr

---
 sway/input/seatop_default.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index 881384719..e3726dd1c 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -241,7 +241,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
 	bool is_floating_or_child = cont && container_is_floating_or_child(cont);
 	bool is_fullscreen_or_child = cont && container_is_fullscreen_or_child(cont);
 	enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE;
-	enum wlr_edges resize_edge = edge ?
+	enum wlr_edges resize_edge = cont && edge ?
 		find_resize_edge(cont, cursor) : WLR_EDGE_NONE;
 	bool on_border = edge != WLR_EDGE_NONE;
 	bool on_contents = cont && !on_border && surface;