Salome HOME
Issue #1766: Dump : crash SALOME when I load a script
authordbv <dbv@opencascade.com>
Thu, 22 Sep 2016 08:48:18 +0000 (11:48 +0300)
committerdbv <dbv@opencascade.com>
Thu, 22 Sep 2016 08:48:18 +0000 (11:48 +0300)
Fix for crash when invalid name of face entered in Python API

src/Model/Model_SelectionNaming.cpp

index 75baa4744158a329ecfb5f695892eaf125104020..87c881c1766f1d0b72416725f4b1008282497391 100644 (file)
@@ -410,7 +410,7 @@ size_t ParseName(const std::string& theSubShapeName,   std::list<std::string>& t
 const TopoDS_Shape findCommonShape(
   const TopAbs_ShapeEnum theType, const TopTools_ListOfShape& theList)
 {
-  if(theList.IsEmpty()) {
+  if(theList.IsEmpty() || theList.Extent() == 1) {
     return TopoDS_Shape();
   }