core: fix crash in data device on shutdown (#9997)

This commit is contained in:
Ikalco
2025-04-09 11:08:42 -05:00
committed by GitHub
parent 0a7e2cb152
commit 0dc531c4a7

View File

@@ -420,7 +420,7 @@ void CWLDataDeviceProtocol::destroyResource(CWLDataOfferResource* resource) {
SP<IDataDevice> CWLDataDeviceProtocol::dataDeviceForClient(wl_client* c) {
#ifndef NO_XWAYLAND
if (g_pXWayland->pServer && c == g_pXWayland->pServer->xwaylandClient)
if (g_pXWayland && g_pXWayland->pServer && c == g_pXWayland->pServer->xwaylandClient)
return g_pXWayland->pWM->getDataDevice();
#endif