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
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