diff --git a/server-client.c b/server-client.c index 2ac0eba9..1cd8f4cc 100644 --- a/server-client.c +++ b/server-client.c @@ -1022,7 +1022,8 @@ have_event: /* Only change pane if not already dragging a pane border. */ if (lwp == NULL) { lwp = wp = window_get_active_at(w, px, py); - c->tty.mouse_last_pane = wp->id; + if (wp != NULL) + c->tty.mouse_last_pane = wp->id; } if (c->tty.mouse_scrolling_flag == 0 && loc == KEYC_MOUSE_LOCATION_SCROLLBAR_SLIDER) {