aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/node.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-09-15 09:42:46 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-09-15 09:42:49 +0100
commit34dbbb1314af16e388c7517aec6427baa00fb179 (patch)
treea05b996b9f513e008f8879fab5604462853e156b /sway/tree/node.c
parentipc: add focus information to root node (diff)
downloadsway-34dbbb1314af16e388c7517aec6427baa00fb179.tar.gz
sway-34dbbb1314af16e388c7517aec6427baa00fb179.tar.zst
sway-34dbbb1314af16e388c7517aec6427baa00fb179.zip
ipc: handle NULL cases for node_get_output
Diffstat (limited to 'sway/tree/node.c')
-rw-r--r--sway/tree/node.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/tree/node.c b/sway/tree/node.c
index 74661c1a..dcab1c9b 100644
--- a/sway/tree/node.c
+++ b/sway/tree/node.c
@@ -74,8 +74,10 @@ void node_get_box(struct sway_node *node, struct wlr_box *box) {
74 74
75struct sway_output *node_get_output(struct sway_node *node) { 75struct sway_output *node_get_output(struct sway_node *node) {
76 switch (node->type) { 76 switch (node->type) {
77 case N_CONTAINER: 77 case N_CONTAINER: {
78 return node->sway_container->workspace->output; 78 struct sway_workspace *ws = node->sway_container->workspace;
79 return ws ? ws->output : NULL;
80 }
79 case N_WORKSPACE: 81 case N_WORKSPACE:
80 return node->sway_workspace->output; 82 return node->sway_workspace->output;
81 case N_OUTPUT: 83 case N_OUTPUT: