1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030588: Coding - avoid calling operator->() on NULL Handle

Use .get() method instead of operator->() where result can be NULL.
STEPCAFControl_Reader::ReadLayers(), XCAFDoc_ColorTool,
XCAFDoc_LayerTool::SetVisibility() - fixed static functions syntax.
This commit is contained in:
kgv
2019-03-16 18:55:36 +03:00
committed by apn
parent 18434846a3
commit ad67e36766
14 changed files with 54 additions and 52 deletions

View File

@@ -215,9 +215,9 @@ void MAT_Arc::SetFirstArc(const MAT_Side aSide ,
const Handle(MAT_Arc)& anArc)
{
if (aSide == MAT_Left)
firstArcLeft = anArc.operator->();
firstArcLeft = anArc.get();
else
firstArcRight = anArc.operator->();
firstArcRight = anArc.get();
}
//========================================================================
@@ -228,9 +228,9 @@ void MAT_Arc::SetSecondArc(const MAT_Side aSide ,
const Handle(MAT_Arc)& anArc)
{
if (aSide == MAT_Left)
secondArcLeft = anArc.operator->();
secondArcLeft = anArc.get();
else
secondArcRight = anArc.operator->();
secondArcRight = anArc.get();
}
//========================================================================
@@ -243,17 +243,17 @@ void MAT_Arc::SetNeighbour(const MAT_Side aSide,
{
if (aSide == MAT_Left) {
if (aNode == FirstNode())
firstArcLeft = anArc.operator->();
firstArcLeft = anArc.get();
else if (aNode == SecondNode())
secondArcLeft = anArc.operator->();
secondArcLeft = anArc.get();
else
throw Standard_DomainError("MAT_Arc::SetNeighbour");
}
else {
if (aNode == FirstNode())
firstArcRight = anArc.operator->();
firstArcRight = anArc.get();
else if (aNode == SecondNode())
secondArcRight = anArc.operator->();
secondArcRight = anArc.get();
else
throw Standard_DomainError("MAT_Arc::SetNeighbour");
}

View File

@@ -77,7 +77,7 @@ Standard_Integer MAT_BasicElt::GeomIndex() const
//========================================================================
void MAT_BasicElt::SetStartArc(const Handle(MAT_Arc)& anArc)
{
startLeftArc = anArc.operator->();
startLeftArc = anArc.get();
}
@@ -87,7 +87,7 @@ void MAT_BasicElt::SetStartArc(const Handle(MAT_Arc)& anArc)
//========================================================================
void MAT_BasicElt::SetEndArc(const Handle(MAT_Arc)& anArc)
{
endLeftArc = anArc.operator->();
endLeftArc = anArc.get();
}
//========================================================================

View File

@@ -33,7 +33,7 @@ MAT_Node::MAT_Node(const Standard_Integer GeomIndex,
: geomIndex(GeomIndex),
distance(Distance)
{
aLinkedArc = LinkedArc.operator->();
aLinkedArc = LinkedArc.get();
}
//=============================================================================
@@ -156,7 +156,7 @@ Standard_Boolean MAT_Node::Infinite() const
//=============================================================================
void MAT_Node::SetLinkedArc (const Handle(MAT_Arc)& LinkedArc)
{
aLinkedArc = LinkedArc.operator->();
aLinkedArc = LinkedArc.get();
}
//=============================================================================