QmlDesigner: Fix qml warning in the states view

Happens when dragging an invalid item on a state. The item is null
but the check check for undefined. Better approach is to always use the
! operator.

Change-Id: I036e0f2d5231b0b0eb67a8400551c93fa0654ecb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2023-03-20 14:53:49 +02:00
parent f35637c19f
commit b8a78d6cea

View File

@@ -683,7 +683,7 @@ Rectangle {
onEntered: function (drag) {
let dragSource = (drag.source as StateThumbnail)
if (dragSource === undefined)
if (!dragSource)
return
if (dragSource.extendString !== stateThumbnail.extendString
@@ -698,7 +698,7 @@ Rectangle {
onDropped: function (drop) {
let dropSource = (drop.source as StateThumbnail)
if (dropSource === undefined)
if (!dropSource)
return
if (dropSource.extendString !== stateThumbnail.extendString