QmlDesigner: fix crash at shutdown

Found at sentry https://the-qt-company-00.sentry.io/issues/4729592969

Change-Id: I3e4903eebf5d328361a04f276659bd143eed0925
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit 4279bdb31c)
This commit is contained in:
Tim Jenssen
2024-05-06 10:12:42 +02:00
parent c8687978fb
commit bf22befb9d

View File

@@ -96,7 +96,8 @@ void TextEditorView::modelAboutToBeDetached(Model *model)
{
AbstractView::modelAboutToBeDetached(model);
m_widget->setTextEditor(nullptr);
if (m_widget)
m_widget->setTextEditor(nullptr);
// in case the user closed it explicit we do not want to do anything with the editor
if (Core::ModeManager::currentModeId() == Core::Constants::MODE_DESIGN) {