From a74060381b581aae253b34b1056759d62027543f Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 14 Jul 2022 02:19:36 +0000 Subject: [PATCH] cursor: Fix crash when creating a cursor constraint Fix crash when creating a cursor constraint and there is no currently focused view. Fixes a crash starting Warhammer 40,000: Dawn of War II (15620) --- src/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cursor.c b/src/cursor.c index 4489eb33..93c4f03d 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -410,7 +410,7 @@ create_constraint(struct wl_listener *listener, void *data) wl_signal_add(&wlr_constraint->events.destroy, &constraint->destroy); view = desktop_focused_view(server); - if (view->surface == wlr_constraint->surface) { + if (view && view->surface == wlr_constraint->surface) { constrain_cursor(server, wlr_constraint); } }