data-device: fix edge case crash on null xwm

fixes #8787
This commit is contained in:
Vaxry 2024-12-21 15:08:00 +00:00
parent 71dc9f6128
commit 52ee7a8748

View file

@ -731,14 +731,16 @@ bool CWLDataDeviceProtocol::wasDragSuccessful() {
} }
#ifndef NO_XWAYLAND #ifndef NO_XWAYLAND
for (auto const& o : g_pXWayland->pWM->dndDataOffers) { if (g_pXWayland->pWM) {
if (o->dead || !o->source || !o->source->hasDnd()) for (auto const& o : g_pXWayland->pWM->dndDataOffers) {
continue; if (o->dead || !o->source || !o->source->hasDnd())
continue;
if (o->source != dnd.currentSource) if (o->source != dnd.currentSource)
continue; continue;
return true; return true;
}
} }
#endif #endif