summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/autotest/testtreemodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/autotest/testtreemodel.cpp b/plugins/autotest/testtreemodel.cpp
index 2ee021ad06..134a9dc214 100644
--- a/plugins/autotest/testtreemodel.cpp
+++ b/plugins/autotest/testtreemodel.cpp
@@ -598,7 +598,8 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
QString TestTreeModel::getMainFileForUnnamedQuickTest(const QString &qmlFile) const
{
const TestTreeItem *unnamed = unnamedQuickTests();
- for (int row = 0, count = unnamed->childCount(); row < count; ++row) {
+ const int count = unnamed ? unnamed->childCount() : 0;
+ for (int row = 0; row < count; ++row) {
const TestTreeItem *child = unnamed->child(row);
if (qmlFile == child->filePath())
return child->mainFile();