summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/format.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-10-14 09:24:07 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-10-14 09:24:07 +0000
commit14761d5b086be24cb09414a38e6761e312ff24d4 (patch)
treee8e0ab461ac571966895eb8574b6f254ae0c2edf /usr.bin/tmux/format.c
parentee034c957dca10809876ee5964cc357546efa9bc (diff)
Do not crash with pane_current_command if the pane is newly created and
has no shell set, from Thomas Adam.
Diffstat (limited to 'usr.bin/tmux/format.c')
-rw-r--r--usr.bin/tmux/format.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index e68d833cc1d..b54e2e5ee0d 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.211 2019/09/24 14:50:08 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.212 2019/10/14 09:24:06 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -574,7 +574,7 @@ format_cb_current_command(struct format_tree *ft, struct format_entry *fe)
struct window_pane *wp = ft->wp;
char *cmd;
- if (wp == NULL)
+ if (wp == NULL || wp->shell == NULL)
return;
cmd = get_proc_name(wp->fd, wp->tty);