Skip to content

Commit

Permalink
QmlDesigner: Really prevent possible nullptr access
Browse files Browse the repository at this point in the history
c163240 added the check for
!projectNode but then used the pointer anyway

Change-Id: Ied63fd0991b0de1dab3d19cd57c00acd596bf752
Reviewed-by: Tobias Hunger <[email protected]>
  • Loading branch information
rlohning committed Mar 22, 2017
1 parent 42e538d commit 00bb242
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/qmldesigner/documentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 00bb242

Please sign in to comment.