diff options
author | Christian Stenger <christian.stenger@qt.io> | 2020-09-15 14:36:26 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2020-09-15 12:59:05 +0000 |
commit | 745beb76348f3589632d6cd19dc47865e404ee77 (patch) | |
tree | ff37036e43ca98d1da084547358e1400c6c002e6 | |
parent | 7ca297cb25c9828bd3193fa2bc44c9177640ae1d (diff) |
AutoTest: Fix possible nullptr access
If the process of the test executable cannot be started
for whatever reason we will not have an active run
configuration or output reader.
Change-Id: I50146a2c8228ad39574e007ae2659465122ad20b
Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r-- | src/plugins/autotest/testrunner.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 56973b01df..b553f28f82 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -268,7 +268,7 @@ void TestRunner::cancelCurrent(TestRunner::CancelReason reason) void TestRunner::onProcessFinished() { - if (m_executingTests && QTC_GUARD(m_currentConfig)) { + if (m_executingTests && m_currentConfig) { QTC_CHECK(m_fakeFutureInterface); m_fakeFutureInterface->setProgressValue(m_fakeFutureInterface->progressValue() + m_currentConfig->testCaseCount()); @@ -286,13 +286,15 @@ void TestRunner::onProcessFinished() } } } - const int disabled = m_currentOutputReader->disabledTests(); - if (disabled > 0) - emit hadDisabledTests(disabled); - if (m_currentOutputReader->hasSummary()) - emit reportSummary(m_currentOutputReader->id(), m_currentOutputReader->summary()); + if (m_currentOutputReader) { + const int disabled = m_currentOutputReader->disabledTests(); + if (disabled > 0) + emit hadDisabledTests(disabled); + if (m_currentOutputReader->hasSummary()) + emit reportSummary(m_currentOutputReader->id(), m_currentOutputReader->summary()); - m_currentOutputReader->resetCommandlineColor(); + m_currentOutputReader->resetCommandlineColor(); + } resetInternalPointers(); if (!m_fakeFutureInterface) { |