Fix crash when killing the current window, reported by Jesus Rafael

Sanchez in GitHub issue 1760.
This commit is contained in:
nicm 2019-05-27 12:48:52 +00:00
parent 6b332127ca
commit ae3eba6e08

View File

@ -161,6 +161,8 @@ spawn_window(struct spawn_context *sc, char **cause)
xasprintf(cause, "couldn't create window %d", idx);
return (NULL);
}
if (s->curw == NULL)
s->curw = sc->wl;
sc->wl->session = s;
winlink_set_window(sc->wl, w);
} else