add check before array declaration

This commit is contained in:
ptv 2006-06-22 10:53:50 +00:00
parent a6c120d5d8
commit c420fe5dcc

View File

@ -154,7 +154,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
//Get the materials
aLen = theMaterials.length();
aMaterials = new TColStd_HArray1OfInteger (1, aLen);
if ( aLen )
aMaterials = new TColStd_HArray1OfInteger (1, aLen);
for (ind = 0; ind < aLen; ind++) {
aMaterials->SetValue(ind+1, theMaterials[ind]);
}