]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Avoid crash if there is no parent of selection attribute.
authormpv <mpv@opencascade.com>
Wed, 7 Nov 2018 12:23:42 +0000 (15:23 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/Model/Model_AttributeSelection.cpp

index 7cb073f3b2f56cc06fdd0695342d95ee0e96770f..b58e29461ef82fdd19d35a937feafab6803b77c8 100644 (file)
@@ -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<ResultPtr>::iterator aNewCont = aNewContexts.begin();
     TopTools_ListIteratorOfListOfShape aNewValues(aValShapes);