]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL10324. Fix MakePartition() for the case theMaterials.length() == 0
authoreap <eap@opencascade.com>
Mon, 26 Jun 2006 14:50:06 +0000 (14:50 +0000)
committereap <eap@opencascade.com>
Mon, 26 Jun 2006 14:50:06 +0000 (14:50 +0000)
src/GEOM_I/GEOM_IBooleanOperations_i.cc

index bbcf768ff8f7c50c6200a8390e1217822c487e84..56726b072f230ba5db61a3869bd19b577de20658 100644 (file)
@@ -154,9 +154,11 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
 
   //Get the materials
   aLen = theMaterials.length();
-  aMaterials = new TColStd_HArray1OfInteger (1, aLen);
-  for (ind = 0; ind < aLen; ind++) {
-    aMaterials->SetValue(ind+1, theMaterials[ind]);
+  if ( aLen ) {
+    aMaterials = new TColStd_HArray1OfInteger (1, aLen);
+    for (ind = 0; ind < aLen; ind++) {
+      aMaterials->SetValue(ind+1, theMaterials[ind]);
+    }
   }
 
   // Make Partition