diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-04-04 13:54:29 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-04 08:43:50 +0200 |
commit | 38d535bd9a4aca8a897e2ae15aed13daa822de2d (patch) | |
tree | ab2b1335935be1b34cc8858aee38fbde1ae463a8 /src/qml/qml/qqmlproperty.cpp | |
parent | 639208cc7f3ab3d8356363559e8fcf168e32cf0b (diff) |
Do not crash on invalid binding diagnostic
If there is no meta object for the property type of the recipient of
an invalid binding, fall back to QMetaType::typename().
Task-number: QTBUG-25161
Change-Id: I0bb768cbc166c04f62d20d8bb19e6ae883d7dc2f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 88223ddf4a..e010fd510c 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1522,8 +1522,9 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, if (QObject *o = *(QObject **)value.constData()) { valueType = o->metaObject()->className(); - const QMetaObject *propertyMetaObject = rawMetaObjectForType(QQmlEnginePrivate::get(engine), type); - propertyType = propertyMetaObject->className(); + if (const QMetaObject *propertyMetaObject = rawMetaObjectForType(QQmlEnginePrivate::get(engine), type)) { + propertyType = propertyMetaObject->className(); + } } } else if (value.userType() != QVariant::Invalid) { valueType = QMetaType::typeName(value.userType()); |