forked from qt-creator/qt-creator
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:
@@ -195,6 +195,9 @@ bool PxNodeController::hasDiagramForExplorerNode(const ProjectExplorer::Node *no
|
|||||||
|
|
||||||
qmt::MDiagram *PxNodeController::findDiagramForExplorerNode(const ProjectExplorer::Node *node)
|
qmt::MDiagram *PxNodeController::findDiagramForExplorerNode(const ProjectExplorer::Node *node)
|
||||||
{
|
{
|
||||||
|
if (!node)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
QStringList relativeElements = qmt::NameController::buildElementsPath(
|
QStringList relativeElements = qmt::NameController::buildElementsPath(
|
||||||
d->pxnodeUtilities->calcRelativePath(node, d->anchorFolder), false);
|
d->pxnodeUtilities->calcRelativePath(node, d->anchorFolder), false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user