Do not attempt to update focus (and crash) when there is no previous window.

This commit is contained in:
nicm 2022-02-22 13:31:18 +00:00 committed by Nicholas Marriott
parent a26ebccd42
commit 046530878b

View File

@ -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);