QmlDesigner: fix crash at shutdown

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

Pick-to: qds/4.5
Change-Id: I3e4903eebf5d328361a04f276659bd143eed0925
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2024-05-06 10:12:42 +02:00
parent 61d936af89
commit 4279bdb31c

View File

@@ -96,7 +96,8 @@ void TextEditorView::modelAboutToBeDetached(Model *model)
{ {
AbstractView::modelAboutToBeDetached(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 // 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) { if (Core::ModeManager::currentModeId() == Core::Constants::MODE_DESIGN) {