From 52ee7a874805bbcbd8f470937c5aacd0c055f7f8 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 21 Dec 2024 15:08:00 +0000 Subject: [PATCH] data-device: fix edge case crash on null xwm fixes #8787 --- src/protocols/core/DataDevice.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index 9447f04f..b4bb8b00 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -731,14 +731,16 @@ bool CWLDataDeviceProtocol::wasDragSuccessful() { } #ifndef NO_XWAYLAND - for (auto const& o : g_pXWayland->pWM->dndDataOffers) { - if (o->dead || !o->source || !o->source->hasDnd()) - continue; + if (g_pXWayland->pWM) { + for (auto const& o : g_pXWayland->pWM->dndDataOffers) { + if (o->dead || !o->source || !o->source->hasDnd()) + continue; - if (o->source != dnd.currentSource) - continue; + if (o->source != dnd.currentSource) + continue; - return true; + return true; + } } #endif