forked from qt-creator/qt-creator
Utils: Fix nullptr access when shell script process fails
When the QtcProcess failed to start, we immediately delete it. Later it would try to access it to retrieve the command line for the error message, which would crash. Change-Id: Ibac942e9a1a91001d90ce7e73d5463c51af81590 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -182,6 +182,8 @@ bool DeviceShell::start()
|
|||||||
|
|
||||||
setupShellProcess(m_shellProcess.get());
|
setupShellProcess(m_shellProcess.get());
|
||||||
|
|
||||||
|
CommandLine cmdLine = m_shellProcess->commandLine();
|
||||||
|
|
||||||
m_shellProcess->setProcessMode(ProcessMode::Writer);
|
m_shellProcess->setProcessMode(ProcessMode::Writer);
|
||||||
|
|
||||||
// Moving the process into its own thread ...
|
// Moving the process into its own thread ...
|
||||||
@@ -232,7 +234,7 @@ bool DeviceShell::start()
|
|||||||
&result);
|
&result);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
startupFailed(m_shellProcess->commandLine());
|
startupFailed(cmdLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user