diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 03:37:59 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 03:37:59 (GMT) |
commit | 76ece6b01e88199349e4c98897b5a846e8253c9d (patch) | |
tree | 1be9cd73f41c7c95d4d5821df3ce523369898894 /src/declarative/qml/qmlengine.cpp | |
parent | e22a3c2ba8fae9514b5adcc35e8215caf3812871 (diff) | |
download | Qt-76ece6b01e88199349e4c98897b5a846e8253c9d.zip Qt-76ece6b01e88199349e4c98897b5a846e8253c9d.tar.gz Qt-76ece6b01e88199349e4c98897b5a846e8253c9d.tar.bz2 |
Don't crash when requesting an attached object for non-QML object
Diffstat (limited to 'src/declarative/qml/qmlengine.cpp')
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index ab3c23a..0e239ce 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -476,6 +476,8 @@ QmlEngine *qmlEngine(const QObject *obj) QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create) { QmlDeclarativeData *data = QmlDeclarativeData::get(object); + if (!data) + return 0; // Attached properties are only on objects created by QML QObject *rv = data->attachedProperties?data->attachedProperties->value(id):0; if (rv || !create) |