AutoTest: Guard against nullptr access

Change-Id: I15e5d769b7a4b30421f52fbbe380ca7f19214b42
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2018-06-20 15:58:28 +02:00
parent 2e6177fe86
commit 3568f23e7e

View File

@@ -216,7 +216,8 @@ void TestRunner::scheduleNext()
void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
{
if (reason == UserCanceled) {
if (!m_fakeFutureInterface->isCanceled()) // depends on using the button / progress bar
// when using the stop button we need to report, for progress bar this happens automatically
if (m_fakeFutureInterface && !m_fakeFutureInterface->isCanceled())
m_fakeFutureInterface->reportCanceled();
}
if (m_currentProcess && m_currentProcess->state() != QProcess::NotRunning) {
@@ -231,6 +232,7 @@ void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
void TestRunner::onProcessFinished()
{
if (m_currentConfig) {
m_fakeFutureInterface->setProgressValue(m_fakeFutureInterface->progressValue()
+ m_currentConfig->testCaseCount());
if (!m_fakeFutureInterface->isCanceled()) {
@@ -246,7 +248,7 @@ void TestRunner::onProcessFinished()
+ rcInfo(m_currentConfig))));
}
}
}
resetInternalPointers();
if (!m_selectedTests.isEmpty() && !m_fakeFutureInterface->isCanceled())