From 36f8fa316d483d19a6399c1b8a18dc4c0fe99081 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 11 Nov 2016 11:37:25 +0000 Subject: Do not crash with run-shell -b and no window pane available, reported by Sergei Dyshel. --- cmd-run-shell.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'cmd-run-shell.c') diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 1c9d5cbe..08f6120a 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -62,7 +62,7 @@ cmd_run_shell_print(struct job *job, const char *msg) if (cdata->wp_id != -1) wp = window_pane_find_by_id(cdata->wp_id); - if (wp == NULL) { + if (cdata->item != NULL && wp == NULL) { cmdq_print(cdata->item, "%s", msg); return; } @@ -100,11 +100,6 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) cdata = xcalloc(1, sizeof *cdata); cdata->cmd = shellcmd; - if (args_has(args, 't') && wp != NULL) - cdata->wp_id = wp->id; - else - cdata->wp_id = -1; - if (args_has(args, 't') && wp != NULL) cdata->wp_id = wp->id; else -- cgit v1.2.3