From 3330faded5ed59b19b2a1982bb52c05322b03510 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 12 Mar 2019 13:57:40 -0400 Subject: Handle seat_get_focused_workspace returning NULL This modifiers the callers of seat_get_focused_workspace to handle getting NULL as the return value, if they did not already. --- sway/commands/focus.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sway/commands/focus.c') 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) { -- cgit v1.2.3