diff options
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index b1f4a8e1bf..2cacb0e546 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -997,8 +997,9 @@ QObject *QmlObjectCreator::createInstance(int index, QObject *parent) context->setIdProperty(idEntry.value(), instance); if (customParser) { - QByteArray data = compiledData->customParserData.value(index); - customParser->setCustomData(instance, data); + QHash<int, QByteArray>::ConstIterator entry = compiledData->customParserData.find(index); + if (entry != compiledData->customParserData.constEnd()) + customParser->setCustomData(instance, *entry); } if (isComponent) |