QmlDesigner: Fix crash

The return was placed incorrectly.
A property called 'path' is required but not sufficient.

Task-number: QDS-1430
Change-Id: I4dbae2fa0f63c36698c5db3480a65eb56fbdb96d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Thomas Hartmann
2021-03-24 20:51:06 +01:00
parent 52fad1870e
commit 9a95611e54

View File

@@ -79,18 +79,18 @@ static int pathRankForModelNode(const ModelNode &modelNode) {
if (modelNode.hasNodeProperty("path")) {
ModelNode pathNode = modelNode.nodeProperty("path").modelNode();
if (pathNode.metaInfo().isSubclassOf("QtQuick.Path") && pathNode.hasNodeListProperty("pathElements")) {
QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements").toModelNodeList();
const QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements")
.toModelNodeList();
if (pathElements.isEmpty())
return 0;
foreach (const ModelNode &pathElement, pathElements) {
for (const ModelNode &pathElement : pathElements) {
if (isNonSupportedPathElement(pathElement))
return 0;
}
}
return 20;
}
return 20;
}
return 0;