patch 8.0.0482: the setbufvar() function may mess up the window layout
Problem: The setbufvar() function may mess up the window layout. (Kay Z.)
Solution: Do not check the window to be valid if it is NULL.
diff --git a/src/window.c b/src/window.c
index 43c9ed2..06f97de 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6563,7 +6563,7 @@
&& check_snapshot_rec(sn->fr_next, fr->fr_next) == FAIL)
|| (sn->fr_child != NULL
&& check_snapshot_rec(sn->fr_child, fr->fr_child) == FAIL)
- || !win_valid(sn->fr_win))
+ || (sn->fr_win != NULL && !win_valid(sn->fr_win)))
return FAIL;
return OK;
}