summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/session.c b/session.c
index 9b9b0d9c..5bc5330e 100644
--- a/session.c
+++ b/session.c
@@ -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);