aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-11-16 16:30:39 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2017-05-07 16:46:49 +0000
commit02830aae1f3e9aaf89ca37637d40313babbff7b8 (patch)
tree638a9516791af32b6625c39b8939fa373b834f1e /src
parent7286b296f97d3394f3c2a716116bd483c9874931 (diff)
Don't crash: Connections with a signal on a nonexistent object
Task-number: QTBUG-56551 Change-Id: Ide09f177d3f6a3e9902f8ea904b3e6e4b998bd39 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index 88ce2fa1b9..d18159841c 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -970,8 +970,11 @@ int QQmlPropertyCache::originalClone(QObject *object, int index)
QQmlData *data = QQmlData::get(object, false);
if (data && data->propertyCache) {
QQmlPropertyCache *cache = data->propertyCache;
- while (cache->signal(index)->isCloned())
+ QQmlPropertyData *sig = cache->signal(index);
+ while (sig && sig->isCloned()) {
--index;
+ sig = cache->signal(index);
+ }
} else {
while (QMetaObjectPrivate::signal(object->metaObject(), index).attributes() & QMetaMethod::Cloned)
--index;