summaryrefslogtreecommitdiffstats
path: root/cmd-show-options.c
diff options
context:
space:
mode:
authornicm <nicm>2019-05-22 18:58:31 +0000
committernicm <nicm>2019-05-22 18:58:31 +0000
commit5571d7a21c5dc920eb9d25336b5bb7b04d72fc9d (patch)
treec1f6ea1badb7c3515e9595442ea81c4e688f9341 /cmd-show-options.c
parentae4cccb4f1c758c717e276fb705e705f24a7ca36 (diff)
Fix crash if window doesn't exist, GitHub issue 1751.
Diffstat (limited to 'cmd-show-options.c')
-rw-r--r--cmd-show-options.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c
index 1e1518f6..2b4651b9 100644
--- a/cmd-show-options.c
+++ b/cmd-show-options.c
@@ -91,7 +91,14 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item)
window = (self->entry == &cmd_show_window_options_entry);
if (args->argc == 0) {
- options_scope_from_flags(args, window, fs, &oo, &cause);
+ scope = options_scope_from_flags(args, window, fs, &oo, &cause);
+ if (scope == OPTIONS_TABLE_NONE) {
+ if (args_has(args, 'q'))
+ return (CMD_RETURN_NORMAL);
+ cmdq_error(item, "%s", cause);
+ free(cause);
+ return (CMD_RETURN_ERROR);
+ }
return (cmd_show_options_all(self, item, oo));
}
argument = format_single(item, args->argv[0], c, s, wl, NULL);