From 046530878b351dc5d99347179f9598d0b40fa268 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. --- session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/session.c b/session.c index d9d9c486..75028882 100644 --- a/session.c +++ b/session.c @@ -501,7 +501,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);