Salome HOME
Exception in Check
authorskv <skv@opencascade.com>
Tue, 28 Jan 2014 09:15:19 +0000 (09:15 +0000)
committerskv <skv@opencascade.com>
Tue, 28 Jan 2014 09:15:19 +0000 (09:15 +0000)
src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx

index 7b1d13987f8caad8ea288988e59377be2c260d02..e7fc90a4ce1f465e2aa180571a292a7562389855 100644 (file)
@@ -360,22 +360,25 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
     return;
   }
 
-  GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem];
-  GEOM::ListOfLong aObjLst = aErr.incriminated;
-  QStringList aSubShapeList;
-  TopoDS_Shape aSelShape;
-  if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) {
-    TopTools_IndexedMapOfShape anIndices;
-    TopExp::MapShapes( aSelShape, anIndices );
-    for ( int i = 0, n = aObjLst.length(); i < n; i++ ) {
-      TopoDS_Shape aSubShape = anIndices.FindKey( aObjLst[i] );
-      QString aType = GEOMBase::GetShapeTypeString( aSubShape );
-      if ( !aType.isEmpty() )
-        aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) );
+  myGrp->ListBox2->clear();
+
+  if (aCurItem < aErrs.length()) {
+    GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem];
+    GEOM::ListOfLong aObjLst = aErr.incriminated;
+    QStringList aSubShapeList;
+    TopoDS_Shape aSelShape;
+    if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) {
+      TopTools_IndexedMapOfShape anIndices;
+      TopExp::MapShapes( aSelShape, anIndices );
+      for ( int i = 0, n = aObjLst.length(); i < n; i++ ) {
+        TopoDS_Shape aSubShape = anIndices.FindKey( aObjLst[i] );
+        QString aType = GEOMBase::GetShapeTypeString( aSubShape );
+        if ( !aType.isEmpty() )
+          aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) );
+      }
     }
+    myGrp->ListBox2->addItems( aSubShapeList );
   }
-  myGrp->ListBox2->clear();
-  myGrp->ListBox2->addItems( aSubShapeList );
 }
 
 //=================================================================================