diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-05-05 00:19:40 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-05-05 00:19:40 (GMT) |
commit | 3b3ec6bc4114db82462eef812a47db420d4505c2 (patch) | |
tree | 6ebe20224b6f2995e34b473ae71697caf60badaf /src/declarative/qml/qdeclarativeobjectscriptclass.cpp | |
parent | 337dbd5391b4e2b1bd88918a46f3392df8fd1312 (diff) | |
download | Qt-3b3ec6bc4114db82462eef812a47db420d4505c2.zip Qt-3b3ec6bc4114db82462eef812a47db420d4505c2.tar.gz Qt-3b3ec6bc4114db82462eef812a47db420d4505c2.tar.bz2 |
Fix a crash with null objects returned from a Q_INVOKABLE
Task-number: QTBUG-10412
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative/qml/qdeclarativeobjectscriptclass.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 03366f0..170f440 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -775,7 +775,8 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e) return QScriptDeclarativeClass::Value(engine, *((QString *)&data)); } else if (type == QMetaType::QObjectStar) { QObject *object = *((QObject **)&data); - QDeclarativeData::get(object, true)->setImplicitDestructible(); + if (object) + QDeclarativeData::get(object, true)->setImplicitDestructible(); QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e); return QScriptDeclarativeClass::Value(engine, priv->objectClass->newQObject(object)); } else if (type == qMetaTypeId<QList<QObject *> >()) { |