summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-02-22 13:31:19 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-02-22 13:31:19 +0000
commitc2977b9d0688f9a22a893d6ea3f2273735118b24 (patch)
tree85cba94675933aa7eb2910add2527432cf74e728 /usr.bin
parent879f405d550846b39cab6d5bcf28dfec5f4ae346 (diff)
Do not attempt to update focus (and crash) when there is no previous window.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index f710bd75520..4b1b54605e0 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.91 2022/02/22 11:10:41 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.92 2022/02/22 13:31:18 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -503,7 +503,8 @@ session_set_current(struct session *s, struct winlink *wl)
winlink_stack_push(&s->lastw, s->curw);
s->curw = wl;
if (options_get_number(global_options, "focus-events")) {
- window_update_focus(old->window);
+ if (old != NULL)
+ window_update_focus(old->window);
window_update_focus(wl->window);
}
winlink_clear_flags(wl);