QtcProcess: Ensure we set the data just after creating handle

...instead of ensuring in many functions that m_setup isn't null.
This amends 36c49cd2ea and
solves the issue for other functions like processId(),
exitCode(), etc...

Amends 36c49cd2ea

Change-Id: I986f7b30e90e5825ae2bb57b4bc2aa14f56e401f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-03-02 18:35:27 +01:00
parent acd7445c6e
commit ac3aa805b9
2 changed files with 1 additions and 3 deletions

View File

@@ -337,14 +337,12 @@ int CallerHandle::exitCode() const
QString CallerHandle::errorString() const
{
QTC_ASSERT(isCalledFromCallersThread(), return {});
QTC_ASSERT(m_setup.get(), return {});
return m_setup->m_errorString;
}
void CallerHandle::setErrorString(const QString &str)
{
QTC_ASSERT(isCalledFromCallersThread(), return);
QTC_ASSERT(m_setup.get(), return);
m_setup->m_errorString = str;
}