diff options
author | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-05-19 11:00:45 +0200 |
---|---|---|
committer | David Schulz <david.schulz@theqtcompany.com> | 2015-05-19 12:11:42 +0300 |
commit | c5fad3756006429026165a345b9eadcd4b5425df (patch) | |
tree | 5a7e938ee8f3a0d48eb02e586427ec682691be4e | |
parent | 5b93689702d45025b4b36cf65c807be21eeb3c05 (diff) | |
download | qt-creator-c5fad3756006429026165a345b9eadcd4b5425df.tar.gz |
Avoid null pointer access
Change-Id: Ie6f64a97d1d97efaa1e1f3ea784a119981159e62
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
-rw-r--r-- | plugins/autotest/testtreemodel.cpp | 3 |
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(); |