diff options
author | emersion <contact@emersion.fr> | 2018-10-08 15:42:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 15:42:19 +0200 |
commit | 1c1fbd49db9a493af8101792ceede5f035724a6d (patch) | |
tree | 874d11e0cb5552eba5de0e9a39e050c537435c06 | |
parent | 6cb0e58c6d26efa2bca9b3710df08ed1aea09aea (diff) | |
parent | 08139daaa418c21f215d0adf6916db472fd474ef (diff) |
Merge pull request #2794 from johnae/fix-opacity-crashing-bug
Check if there is a current container before setting its opacity
-rw-r--r-- | sway/commands/opacity.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/opacity.c b/sway/commands/opacity.c index 9cdaad7f..4e4fc994 100644 --- a/sway/commands/opacity.c +++ b/sway/commands/opacity.c @@ -21,6 +21,10 @@ struct cmd_results *cmd_opacity(int argc, char **argv) { struct sway_container *con = config->handler_context.container; + if (con == NULL) { + return cmd_results_new(CMD_FAILURE, "opacity", "No current container"); + } + float opacity = 0.0f; if (!parse_opacity(argv[0], &opacity)) { |