aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r--sway/commands/focus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 25df5130..6344a765 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -208,6 +208,11 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
"There is no output with that name");
}
struct sway_workspace *ws = seat_get_focused_workspace(seat);
+ if (!ws) {
+ free(identifier);
+ return cmd_results_new(CMD_FAILURE,
+ "No focused workspace to base directions off of");
+ }
output = output_get_in_direction(ws->output, direction);
if (!output) {