effects/private: Add another guard for multi-screen Drag&Drop

Unlike D&D actions, this method does not return any feedback as to
whether an item drop was accepted by any other screen, and so whether it
is going through destruction process already, so the best we can do is
add another typeof/undefined check after calling that method.

Fixes the following error:

    file:///usr/lib/qml/org/kde/kwin/private/effects/WindowHeapDelegate.qml:415:
    TypeError: Cannot read property 'deleteDND' of undefined
This commit is contained in:
ivan tkachenko 2022-09-19 15:11:31 +03:00
parent d8faf8ab08
commit ab79fe47ce
No known key found for this signature in database
GPG key ID: AF72731B7C654CB3

View file

@ -411,9 +411,11 @@ Item {
var globalPos = targetScreen.mapToGlobal(centroid.scenePosition);
effect.checkItemDroppedOutOfScreen(globalPos, thumbSource);
// else, return to normal without reparenting
thumbSource.deleteDND();
thumb.substate = "normal";
if (typeof thumbSource !== "undefined") {
// else, return to normal without reparenting
thumbSource.deleteDND();
thumb.substate = "normal";
}
}
}
}