diff options
Diffstat (limited to 'sway/commands/workspace.c')
-rw-r--r-- | sway/commands/workspace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index 362dcd1b..b911b2f6 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c | |||
@@ -185,8 +185,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { | |||
185 | struct sway_seat *seat = config->handler_context.seat; | 185 | struct sway_seat *seat = config->handler_context.seat; |
186 | struct sway_workspace *current = seat_get_focused_workspace(seat); | 186 | struct sway_workspace *current = seat_get_focused_workspace(seat); |
187 | if (!current) { | 187 | if (!current) { |
188 | return cmd_results_new(CMD_FAILURE, "workspace", | 188 | return cmd_results_new(CMD_FAILURE, "No workspace to switch from"); |
189 | "No workspace to switch from"); | ||
190 | } | 189 | } |
191 | 190 | ||
192 | struct sway_workspace *ws = NULL; | 191 | struct sway_workspace *ws = NULL; |
@@ -227,6 +226,9 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { | |||
227 | } | 226 | } |
228 | free(name); | 227 | free(name); |
229 | } | 228 | } |
229 | if (!ws) { | ||
230 | return cmd_results_new(CMD_FAILURE, "No workspace to switch to"); | ||
231 | } | ||
230 | workspace_switch(ws, no_auto_back_and_forth); | 232 | workspace_switch(ws, no_auto_back_and_forth); |
231 | seat_consider_warp_to_focus(seat); | 233 | seat_consider_warp_to_focus(seat); |
232 | } | 234 | } |