diff options
author | Vaxry <[email protected]> | 2024-12-21 15:08:00 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-12-21 15:08:00 +0000 |
commit | 52ee7a874805bbcbd8f470937c5aacd0c055f7f8 (patch) | |
tree | 43e584f441387a434309e4cb0561f7d90f4d7245 | |
parent | 71dc9f6128b8d2e382b2a574d2d5f15e2d907f3a (diff) | |
download | Hyprland-52ee7a874805bbcbd8f470937c5aacd0c055f7f8.tar.gz Hyprland-52ee7a874805bbcbd8f470937c5aacd0c055f7f8.zip |
data-device: fix edge case crash on null xwm
fixes #8787
-rw-r--r-- | src/protocols/core/DataDevice.cpp | 14 |
1 files 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 |