diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index 986d1176c..2d50ff157 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -644,11 +644,13 @@ void CWLDataDeviceProtocol::abortDrag() { g_pInputManager->unsetCursorImage(); dnd.overriddenCursor = false; - if (!dnd.focusedDevice || !dnd.currentSource) + if (!dnd.focusedDevice && !dnd.currentSource) return; - dnd.focusedDevice->sendLeave(); - dnd.currentSource->cancelled(); + if (dnd.focusedDevice) + dnd.focusedDevice->sendLeave(); + if (dnd.currentSource) + dnd.currentSource->cancelled(); dnd.focusedDevice.reset(); dnd.currentSource.reset();