From 728c8ef29a24a754be3bc34f60d0716896af542c Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 22 Feb 2022 13:31:18 +0000 Subject: [PATCH] Do not attempt to update focus (and crash) when there is no previous window. --- usr.bin/tmux/session.c | 5 +++-- 1 file 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 @@ -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); -- 2.20.1