ModelEditor: Avoid accessing nullptr

When triggering the context menu on the navigation treeview and
having a model editor open QC might not find a node at all.

Task-number: QTCREATORBUG-20559
Change-Id: I71bc3e7c3f405460dd2af0a2b0cc7f1e6d3b68b6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Christian Stenger
2018-06-05 12:26:38 +02:00
parent 21c9740089
commit 07ccefc1bd

View File

@@ -195,6 +195,9 @@ bool PxNodeController::hasDiagramForExplorerNode(const ProjectExplorer::Node *no
qmt::MDiagram *PxNodeController::findDiagramForExplorerNode(const ProjectExplorer::Node *node)
{
if (!node)
return nullptr;
QStringList relativeElements = qmt::NameController::buildElementsPath(
d->pxnodeUtilities->calcRelativePath(node, d->anchorFolder), false);