aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/sticky.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-10-12 09:21:48 +1000
committerGitHub <noreply@github.com>2018-10-12 09:21:48 +1000
commitf52af18e0d5e9eb1b28f237192cb9c22656e3247 (patch)
tree3bd74d7ffd9bf2c3fbb05fe0efd377486851cfa0 /sway/commands/sticky.c
parente17a99287d31216233e21b0a96f559c31ff03528 (diff)
parent27fb146121f521879a7ad077c0ffd813b50827c5 (diff)
Merge pull request #2821 from meakio/master
fix: cmd_sticky crash sway with empty container
Diffstat (limited to 'sway/commands/sticky.c')
-rw-r--r--sway/commands/sticky.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands/sticky.c b/sway/commands/sticky.c
index 7995cdd6..f18322b7 100644
--- a/sway/commands/sticky.c
+++ b/sway/commands/sticky.c
@@ -16,6 +16,11 @@ struct cmd_results *cmd_sticky(int argc, char **argv) {
return error;
}
struct sway_container *container = config->handler_context.container;
+
+ if (container == NULL) {
+ return cmd_results_new(CMD_FAILURE, "sticky", "No current container");
+ };
+
if (!container_is_floating(container)) {
return cmd_results_new(CMD_FAILURE, "sticky",
"Can't set sticky on a tiled container");