From 02830aae1f3e9aaf89ca37637d40313babbff7b8 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 16 Nov 2016 16:30:39 +0100 Subject: Don't crash: Connections with a signal on a nonexistent object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-56551 Change-Id: Ide09f177d3f6a3e9902f8ea904b3e6e4b998bd39 Reviewed-by: Jan Arve Sæther --- src/qml/qml/qqmlpropertycache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/qml') 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; -- cgit v1.2.3