Avoid null pointer access

Change-Id: Ie6f64a97d1d97efaa1e1f3ea784a119981159e62
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-05-19 11:00:45 +02:00
committed by David Schulz
parent 5b93689702
commit c5fad37560

View File

@@ -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();