Debugger: Check if m_perspective is valid before using it

When debugging a remote machine using ssh, if the ssh connection returns
an error before other workers are fully started, and it will call
destroyPerspective(). Then the other workers will call setState() when
they are in EngineSetupOk and then in EngineRunRequested.
Before calling select() method check if m_perspective is valid.

Fixes: QTCREATORBUG-23415
Change-Id: Ib174015b1d11cdaa5f59e7ccb012b849d49672f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Marius Sincovici
2019-12-25 20:02:11 +01:00
parent 04b3c56a2b
commit 9165119819

View File

@@ -1828,7 +1828,8 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
if (state == EngineRunRequested) {
emit engineStarted();
d->m_perspective->select();
if (d->m_perspective)
d->m_perspective->select();
}
showMessage(msg, LogDebug);