summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-10-19 06:39:29 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-10-19 06:39:29 +0000
commit0fc0ce89496393e5d606d7089c91f5048d40ac42 (patch)
treead644ac0f17000f9461f443a787a8aec070e90bc
parent908b4c4ec3fea626b098d1cd43d4054c9685d70a (diff)
Client could be NULL in select-window (for example in .tmux.conf), do
not set latest session if so. GitHub issue 2429 from Han Boetes.
-rw-r--r--usr.bin/tmux/cmd-select-window.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-select-window.c b/usr.bin/tmux/cmd-select-window.c
index 21eb2689607..9466be06f31 100644
--- a/usr.bin/tmux/cmd-select-window.c
+++ b/usr.bin/tmux/cmd-select-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-window.c,v 1.28 2020/05/16 16:45:55 nicm Exp $ */
+/* $OpenBSD: cmd-select-window.c,v 1.29 2020/10/19 06:39:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -142,7 +142,7 @@ cmd_select_window_exec(struct cmd *self, struct cmdq_item *item)
}
cmdq_insert_hook(s, item, current, "after-select-window");
}
- if (c->session != NULL)
+ if (c != NULL && c->session != NULL)
s->curw->window->latest = c;
recalculate_sizes();