From ab79fe47ceec3939db0f83854f2aaf17e0e922fe Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Mon, 19 Sep 2022 15:11:31 +0300 Subject: [PATCH] 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 --- src/effects/private/qml/WindowHeapDelegate.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/effects/private/qml/WindowHeapDelegate.qml b/src/effects/private/qml/WindowHeapDelegate.qml index cfdf5eba0c..a277d48bed 100644 --- a/src/effects/private/qml/WindowHeapDelegate.qml +++ b/src/effects/private/qml/WindowHeapDelegate.qml @@ -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"; + } } } }