aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/qqmlpropertycachecreator.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.errors.txt1
-rw-r--r--tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.qml9
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp1
4 files changed, 13 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlpropertycachecreator.cpp b/src/qml/qml/qqmlpropertycachecreator.cpp
index 8a51d4ddac..84c935db54 100644
--- a/src/qml/qml/qqmlpropertycachecreator.cpp
+++ b/src/qml/qml/qqmlpropertycachecreator.cpp
@@ -136,8 +136,8 @@ void QQmlPendingGroupPropertyBindings::resolveMissingPropertyCaches(
if (!pendingBinding.resolveInstantiatingProperty())
continue;
- auto cache = pendingBinding.instantiatingPropertyCache();
- propertyCaches->set(groupPropertyObjectIndex, cache);
+ if (auto cache = pendingBinding.instantiatingPropertyCache())
+ propertyCaches->set(groupPropertyObjectIndex, cache);
}
}
diff --git a/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.errors.txt
new file mode 100644
index 0000000000..e072be7a4e
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.errors.txt
@@ -0,0 +1 @@
+8:5:Cannot assign to non-existent property "root"
diff --git a/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.qml b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.qml
new file mode 100644
index 0000000000..edb32af51c
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.11.qml
@@ -0,0 +1,9 @@
+import QtQml
+QtObject {
+ id: root
+ component C : QtObject {
+ property int i
+ }
+ property C c: C {}
+ root.c.i: 4
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index d95f25df98..449fbd9c5b 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -706,6 +706,7 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("invalidGroupedProperty.8") << "invalidGroupedProperty.8.qml" << "invalidGroupedProperty.8.errors.txt" << false;
QTest::newRow("invalidGroupedProperty.9") << "invalidGroupedProperty.9.qml" << "invalidGroupedProperty.9.errors.txt" << false;
QTest::newRow("invalidGroupedProperty.10") << "invalidGroupedProperty.10.qml" << "invalidGroupedProperty.10.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.11") << "invalidGroupedProperty.11.qml" << "invalidGroupedProperty.11.errors.txt" << false;
QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false;
QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false;