From: mpv Date: Wed, 7 Nov 2018 12:23:42 +0000 (+0300) Subject: Avoid crash if there is no parent of selection attribute. X-Git-Tag: End2018~191 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b06cf1477fb1ee46d7ae260c234cac5d0000abf2;p=modules%2Fshaper.git Avoid crash if there is no parent of selection attribute. --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 7cb073f3b..b58e29461 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -1421,9 +1421,11 @@ void Model_AttributeSelection::updateInHistory() if (searchNewContext(aDoc, aNewCShape, aContext, aValShape, aContLab, aNewContexts, aValShapes)) { GeomAPI_Shape::ShapeType aListShapeType = GeomAPI_Shape::SHAPE; - if (myParent->selectionType() == "VERTEX") aListShapeType = GeomAPI_Shape::VERTEX; - else if (myParent->selectionType() == "EDGE") aListShapeType = GeomAPI_Shape::EDGE; - else if (myParent->selectionType() == "FACE") aListShapeType = GeomAPI_Shape::FACE; + if (myParent) { + if (myParent->selectionType() == "VERTEX") aListShapeType = GeomAPI_Shape::VERTEX; + else if (myParent->selectionType() == "EDGE") aListShapeType = GeomAPI_Shape::EDGE; + else if (myParent->selectionType() == "FACE") aListShapeType = GeomAPI_Shape::FACE; + } std::list::iterator aNewCont = aNewContexts.begin(); TopTools_ListIteratorOfListOfShape aNewValues(aValShapes);