From b32d03bf8985eafde6803ccad6232b945f802548 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 20 May 2021 13:50:41 +0200 Subject: [PATCH] QmlDesigner: Fix crash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the view is not attached we should not access a nullptr. Task-number: QDS-4382 Change-Id: I885f2b1b810d4ffd7b87749ca50e06cbdac3a7e2 Reviewed-by: Tomi Korpipää --- src/plugins/qmldesigner/designercore/model/abstractview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp index 665562a44a4..fa36ea447d6 100644 --- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp +++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp @@ -696,6 +696,7 @@ void AbstractView::setEnabled(bool b) QList AbstractView::allModelNodes() const { + QTC_ASSERT(model(), return {}); return toModelNodeList(model()->d->allNodes()); }