Debugger: Don't access unloaded perspectives

This can happen if a previous session marked a plugin for not
loading and ended the session in a perspective provided by that
plugin.

Change-Id: I83a5dda421a1bb8ed2f8942f03e629e9c5d4d4ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2016-07-25 16:54:51 +02:00
committed by hjk
parent 0651eddbad
commit add9e627b8

View File

@@ -265,7 +265,7 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId,
ICore::removeAdditionalContext(Context(Id::fromName(m_currentPerspectiveId)));
const Perspective *perspective = m_perspectiveForPerspectiveId.value(m_currentPerspectiveId);
QWidget *central = perspective->centralWidget();
QWidget *central = perspective ? perspective->centralWidget() : nullptr;
m_centralWidgetStack->removeWidget(central ? central : m_editorPlaceHolder);
}