From b7d2d56263fe1fd8ca627c02adc521bf79f334b4 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Fri, 2 Aug 2024 09:43:42 +1000 Subject: [PATCH] check for null pointer when getting gaps --- sway/tree/container.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sway/tree/container.c b/sway/tree/container.c index 4977fc16..8f900173 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -350,7 +350,12 @@ static struct sway_container *view_container_at(struct sway_node *parent, } struct sway_container *container = parent->sway_container; - int gaps = container->current.workspace->gaps_inner; + + int gaps = 0; + if (container->current.workspace) { + gaps = container->current.workspace->gaps_inner; + } + struct wlr_box box = { .x = container->pending.x - (gaps / 2), .y = container->pending.y - (gaps / 2),