From bd79584f659428df5d34f64f3b1cdb4c4388c3c6 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 20 May 2018 08:34:43 +1000 Subject: [PATCH] Add assertion in container_at_view --- sway/tree/container.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/tree/container.c b/sway/tree/container.c index 76a21c19..62dca487 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -455,6 +455,9 @@ struct sway_container *container_parent(struct sway_container *container, static struct sway_container *container_at_view(struct sway_container *swayc, double ox, double oy, struct wlr_surface **surface, double *sx, double *sy) { + if (!sway_assert(swayc->type == C_VIEW, "Expected a view")) { + return NULL; + } struct sway_view *sview = swayc->sway_view; double view_sx = ox - sview->x; double view_sy = oy - sview->y;