From 17014c34e2f3568af06b4fc9323256d2b7aa8947 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 17 Oct 2018 19:55:00 +1000 Subject: Fix crashes when running certain commands on an empty workspace This fixes crashes when running the border, mark, unmark and title_format commands on an empty workspace. --- sway/commands/unmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands/unmark.c') diff --git a/sway/commands/unmark.c b/sway/commands/unmark.c index c6251dc8..c671ed4e 100644 --- a/sway/commands/unmark.c +++ b/sway/commands/unmark.c @@ -25,7 +25,7 @@ struct cmd_results *cmd_unmark(int argc, char **argv) { struct sway_view *view = NULL; if (config->handler_context.using_criteria) { struct sway_container *container = config->handler_context.container; - if (!container->view) { + if (!container || !container->view) { return cmd_results_new(CMD_INVALID, "unmark", "Only views can have marks"); } -- cgit v1.2.3