aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-07-06 14:32:46 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-07-06 12:35:03 +0000
commit06a60b9ff81a0dea291bb3827c161d26c8c4e75c (patch)
tree1bf323b8aabff050885827815b57008d08d12efc
parentabf2a634a05a3b7710d807e5e9f266225449d0da (diff)
Autotools: Be a bit more paranoid with pointers
Change-Id: I61911287c88c9e13718b08af2542e9bcc6c4aa08 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsproject.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
index 4e7afec62f..64053b4a5b 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
@@ -284,7 +284,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
FolderNode *parentFolder = 0;
FolderNode *oldParentFolder = 0;
- foreach (const QString& file, files) {
+ foreach (const QString &file, files) {
if (file.endsWith(QLatin1String(".moc")))
continue;
@@ -306,8 +306,8 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
parentFolder = m_rootNode;
}
}
- QTC_ASSERT(parentFolder != 0, return);
- if ((oldParentFolder != parentFolder) && !fileNodes.isEmpty()) {
+ QTC_ASSERT(parentFolder, return);
+ if (oldParentFolder && (oldParentFolder != parentFolder) && !fileNodes.isEmpty()) {
// AutotoolsProjectNode::addFileNodes() is a very expensive operation. It is
// important to collect as much file nodes of the same parent folder as
// possible before invoking it.
@@ -328,7 +328,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
}
}
- if (!fileNodes.isEmpty())
+ if (parentFolder && !fileNodes.isEmpty())
parentFolder->addFileNodes(fileNodes);
// Remove unused file nodes and empty folder nodes