aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 12:03:13 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 12:03:13 +1000
commit8859da1dc32f49d33a28878e6adfb266fe7aa43a (patch)
tree46dde5776f7ad6bdfe3486ebc4bb949670850ccf /sway/commands/focus.c
parentMerge pull request #2582 from ascent12/func (diff)
downloadsway-8859da1dc32f49d33a28878e6adfb266fe7aa43a.tar.gz
sway-8859da1dc32f49d33a28878e6adfb266fe7aa43a.tar.zst
sway-8859da1dc32f49d33a28878e6adfb266fe7aa43a.zip
Fix crash when focusing from fullscreen in an invalid direction
* Fullscreen a view * Run `focus <direction>` where there is no output in that direction The output returned was rightfully NULL, which needs to be handled.
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r--sway/commands/focus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 83b8c64a..58721b7e 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -102,6 +102,9 @@ static struct sway_node *node_get_in_direction(struct sway_container *container,
102 // Fullscreen container with a direction - go straight to outputs 102 // Fullscreen container with a direction - go straight to outputs
103 struct sway_output *output = container->workspace->output; 103 struct sway_output *output = container->workspace->output;
104 struct sway_output *new_output = output_get_in_direction(output, dir); 104 struct sway_output *new_output = output_get_in_direction(output, dir);
105 if (!new_output) {
106 return NULL;
107 }
105 return get_node_in_output_direction(new_output, dir); 108 return get_node_in_output_direction(new_output, dir);
106 } 109 }
107 if (dir == MOVE_PARENT) { 110 if (dir == MOVE_PARENT) {