check for null pointer when getting gaps
This commit is contained in:
parent
5293fb9206
commit
a81e80fe68
|
@ -350,7 +350,12 @@ static struct sway_container *view_container_at(struct sway_node *parent,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sway_container *container = parent->sway_container;
|
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 = {
|
struct wlr_box box = {
|
||||||
.x = container->pending.x - (gaps / 2),
|
.x = container->pending.x - (gaps / 2),
|
||||||
.y = container->pending.y - (gaps / 2),
|
.y = container->pending.y - (gaps / 2),
|
||||||
|
|
Loading…
Reference in a new issue