summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/documentmanager.cpp
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2017-03-22 12:59:02 +0100
committerRobert Loehning <robert.loehning@qt.io>2017-03-22 13:39:28 +0000
commit00bb2425f560df08cbb91a5329f856b565f27999 (patch)
tree4236c80e7debc86cd6dc8eea3ee21173aa131fca /src/plugins/qmldesigner/documentmanager.cpp
parent42e538d647921691ee71c88357044e00d88b4562 (diff)
downloadqt-creator-00bb2425f560df08cbb91a5329f856b565f27999.tar.gz
QmlDesigner: Really prevent possible nullptr access
c16324061117b2724b2c50eb109b5ab9c13e903d added the check for !projectNode but then used the pointer anyway Change-Id: Ied63fd0991b0de1dab3d19cd57c00acd596bf752 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/documentmanager.cpp')
-rw-r--r--src/plugins/qmldesigner/documentmanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp
index 59412263ac..357420c1d8 100644
--- a/src/plugins/qmldesigner/documentmanager.cpp
+++ b/src/plugins/qmldesigner/documentmanager.cpp
@@ -436,7 +436,9 @@ bool DocumentManager::isoProFileSupportsAddingExistingFiles(const QString &resou
if (!node || !node->parentFolderNode())
return false;
ProjectExplorer::ProjectNode *projectNode = node->parentFolderNode()->asProjectNode();
- if (!projectNode || !projectNode->supportedActions(projectNode).contains(ProjectExplorer::AddExistingFile)) {
+ if (!projectNode)
+ return false;
+ if (!projectNode->supportedActions(projectNode).contains(ProjectExplorer::AddExistingFile)) {
qCWarning(documentManagerLog) << "Project" << projectNode->displayName() << "does not support adding existing files";
return false;
}