]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix of the crash on selection of edge of solid in the neutral point
authormpv <mpv@opencascade.com>
Fri, 27 May 2016 14:04:44 +0000 (17:04 +0300)
committermpv <mpv@opencascade.com>
Fri, 27 May 2016 14:04:44 +0000 (17:04 +0300)
src/Model/Model_Document.cpp

index 88f8bc6cbbedde47235bf2c5c0f2a32873df9360..9994a1422612029e6873f1415bc07d9f8bf61e17 100755 (executable)
@@ -43,6 +43,7 @@
 #include <TNaming_SameShapeIterator.hxx>
 #include <TNaming_Iterator.hxx>
 #include <TNaming_NamedShape.hxx>
+#include <TNaming_Tool.hxx>
 #include <TopExp_Explorer.hxx>
 
 #include <climits>
@@ -1292,6 +1293,8 @@ static Handle(TNaming_NamedShape) searchForOriginalShape(TopoDS_Shape theShape,
   while(!theShape.IsNull()) { // searching for the very initial shape that produces this one
     TopoDS_Shape aShape = theShape;
     theShape.Nullify();
+    if (!TNaming_Tool::HasLabel(aMain, aShape)) // to avoid crash of TNaming_SameShapeIterator if pure shape does not exists
+      break;
     for(TNaming_SameShapeIterator anIter(aShape, aMain); anIter.More(); anIter.Next()) {
       TDF_Label aNSLab = anIter.Label();
       Handle(TNaming_NamedShape) aNS;