Merge pull request #2794 from johnae/fix-opacity-crashing-bug

Check if there is a current container before setting its opacity
This commit is contained in:
emersion 2018-10-08 15:42:19 +02:00 committed by GitHub
commit 1c1fbd49db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {