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.
This commit is contained in:
Ryan Dwyer 2018-10-17 19:55:00 +10:00
parent 434cbaabf0
commit 17014c34e2
4 changed files with 4 additions and 4 deletions

View file

@ -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");
}