summaryrefslogtreecommitdiff
path: root/src/protocols/core/DataDevice.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2025-01-06 15:27:57 +0100
committervaxerski <vaxry@vaxry.net>2025-01-06 15:27:57 +0100
commitf1a7a7497e9b058092e915acd5164dcc162a8260 (patch)
treee14cd1b5aa60580a8d7b9f367360146c22ba4a8e /src/protocols/core/DataDevice.cpp
parentf390f48a07d117e24acec59dcf6791bcb3a81110 (diff)
datadevice: guard XWayland server against crashes
The server might be dead or restarting, and we'd deref null ref #7822
Diffstat (limited to 'src/protocols/core/DataDevice.cpp')
-rw-r--r--src/protocols/core/DataDevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index 6ad17d7b..722eb9fd 100644
--- a/src/protocols/core/DataDevice.cpp
+++ b/src/protocols/core/DataDevice.cpp
@@ -417,7 +417,7 @@ void CWLDataDeviceProtocol::destroyResource(CWLDataOfferResource* resource) {
SP<IDataDevice> CWLDataDeviceProtocol::dataDeviceForClient(wl_client* c) {
#ifndef NO_XWAYLAND
- if (c == g_pXWayland->pServer->xwaylandClient)
+ if (g_pXWayland->pServer && c == g_pXWayland->pServer->xwaylandClient)
return g_pXWayland->pWM->getDataDevice();
#endif