From 3d917a01cc16f79303f6f95dcb63db44af7e290c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 6 Apr 2021 14:02:13 +0200 Subject: [PATCH] QmlDesigner: Fix crash This case should not happen and is handled in a separate patch, but in case we miss another corner case this avoids the crash. Task-number: QTCREATORBUG-25437 Change-Id: I370e3e0b6901d8cdd857714a0766f0f8442a3d66 Reviewed-by: Aleksei German Reviewed-by: Marco Bubke --- .../components/connectioneditor/connectionmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp index 41d98ca6082..c9d2de9e72d 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp @@ -39,6 +39,8 @@ #include #include +#include + #include #include #include @@ -370,7 +372,10 @@ void ConnectionModel::abstractPropertyChanged(const AbstractProperty &abstractPr void ConnectionModel::deleteConnectionByRow(int currentRow) { SignalHandlerProperty targetSignal = signalHandlerPropertyForRow(currentRow); + QTC_ASSERT(targetSignal.isValid(), return ); QmlDesigner::ModelNode node = targetSignal.parentModelNode(); + QTC_ASSERT(node.isValid(), return ); + QList allSignals = node.signalProperties(); if (allSignals.size() > 1) { if (allSignals.contains(targetSignal))