diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index 812b83b6c72..c059a2e9fad 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -5759,7 +5759,8 @@ static void text_input_handle_enter(void *data, zwp_text_input_v3 * /*zwp_text_input_v3*/, wl_surface *surface) { - if (!ghost_wl_surface_own(surface)) { + /* Can be null when closing a window, see: #141777. */ + if (!ghost_wl_surface_own_with_null_check(surface)) { return; } CLOG_DEBUG(LOG, "enter");