From d8593011d2d01a04a01e7bf369caa166d91b3d6a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 18 Sep 2017 18:12:40 +0200 Subject: Fix crash when using signal handlers on group properties This is a regression introduced with commmit 49a11e882059ee1729f776722e085dd21d378c36: The typeRef can be null. I found this when testing grouped properties and property revisions. import QtQuick 2.0 Item { property alias textEdit: textEdit TextEdit { id: textEdit } } import QtQuick 2.8 Item { TestComponent { textEdit.onEditingFinished: console.log("test") } } Instead of an error message, this crashes without this patch. This is a regression introduced by using QQmlType by value. Change-Id: Ib18a0ad878f7c4696c22bc65fee636b84b966f03 Reviewed-by: Simon Hausmann --- src/qml/compiler/qqmltypecompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/compiler') diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index eeb5595a9a..fab865081a 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -412,7 +412,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio const QString &originalPropertyName = stringAt(binding->propertyNameIndex); auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex); - const QQmlType type = typeRef->type; + const QQmlType type = typeRef ? typeRef->type : QQmlType(); if (type.isValid()) { COMPILE_EXCEPTION(binding, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(typeName).arg(originalPropertyName).arg(type.module()).arg(type.majorVersion()).arg(type.minorVersion())); } else { -- cgit v1.2.3