aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-12-21 15:08:00 +0000
committerVaxry <[email protected]>2024-12-21 15:08:00 +0000
commit52ee7a874805bbcbd8f470937c5aacd0c055f7f8 (patch)
tree43e584f441387a434309e4cb0561f7d90f4d7245
parent71dc9f6128b8d2e382b2a574d2d5f15e2d907f3a (diff)
downloadHyprland-52ee7a874805bbcbd8f470937c5aacd0c055f7f8.tar.gz
Hyprland-52ee7a874805bbcbd8f470937c5aacd0c055f7f8.zip
data-device: fix edge case crash on null xwm
fixes #8787
-rw-r--r--src/protocols/core/DataDevice.cpp14
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