aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authornicm <nicm>2022-02-22 13:31:18 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2022-04-06 14:19:50 +0100
commit046530878b351dc5d99347179f9598d0b40fa268 (patch)
tree5cea542b90d6d04d2679080975652f6cddbaf323 /session.c
parenta26ebccd421e53ce1e3fcad6f1db9759cb58b043 (diff)
downloadrtmux-046530878b351dc5d99347179f9598d0b40fa268.tar.gz
rtmux-046530878b351dc5d99347179f9598d0b40fa268.tar.bz2
rtmux-046530878b351dc5d99347179f9598d0b40fa268.zip
Do not attempt to update focus (and crash) when there is no previous window.
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 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);