diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index 83226e3a9..d1a98fb5d 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -420,7 +420,7 @@ void CWLDataDeviceProtocol::destroyResource(CWLDataOfferResource* resource) { SP 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