mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 16:01:27 +00:00
focus: add a NULL check in focus <direction>
container is checked for NULL in other conditions earlier, it's not obvious that it can't be undefined here.
This commit is contained in:
parent
30fa7d191e
commit
cf95de9cae
|
@ -414,6 +414,9 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!sway_assert(container, "Expected container to be non null")) {
|
||||||
|
return cmd_results_new(CMD_FAILURE, "");
|
||||||
|
}
|
||||||
struct sway_node *next_focus = NULL;
|
struct sway_node *next_focus = NULL;
|
||||||
if (container_is_floating(container)) {
|
if (container_is_floating(container)) {
|
||||||
next_focus = node_get_in_direction_floating(container, seat, direction);
|
next_focus = node_get_in_direction_floating(container, seat, direction);
|
||||||
|
|
Loading…
Reference in a new issue