Fixed another crash

This commit is contained in:
Keith Bowes 2025-02-27 11:44:05 -05:00
parent db79d83076
commit 606663a390

View file

@ -173,11 +173,14 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
seat_set_focus_layer(seat, NULL); seat_set_focus_layer(seat, NULL);
} }
struct wb_toplevel *toplevel = wl_container_of(surface->server->toplevels.next, toplevel, link); if (!wl_list_empty(&surface->server->toplevels)) {
struct wb_toplevel *toplevel =
wl_container_of(surface->server->toplevels.next, toplevel, link);
if (toplevel && toplevel->scene_tree && toplevel->scene_tree->node.enabled) { if (toplevel && toplevel->scene_tree && toplevel->scene_tree->node.enabled) {
focus_toplevel(toplevel); focus_toplevel(toplevel);
} }
} }
}
static void wb_layer_surface_destroy(struct wb_layer_surface *surface) { static void wb_layer_surface_destroy(struct wb_layer_surface *surface) {
if (surface == NULL) { if (surface == NULL) {