0025168: STEP Writer - empty AppliedGroupAssignment can cause exception in RWStepAP21...
authordrazmyslovich <razmyslovich@volumegraphics.com>
Tue, 19 Aug 2014 12:28:48 +0000 (14:28 +0200)
committerbugmaster <bugmaster@opencascade.com>
Thu, 21 Aug 2014 11:51:16 +0000 (15:51 +0400)
Function WriteStep is fixed

src/RWStepAP214/RWStepAP214_RWAppliedGroupAssignment.cxx

index e70a81f..18b160e 100644 (file)
@@ -83,9 +83,12 @@ void RWStepAP214_RWAppliedGroupAssignment::WriteStep (StepData_StepWriter& SW,
   // Own fields of AppliedGroupAssignment
 
   SW.OpenSub();
-  for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) {
-    StepAP214_GroupItem Var0 = ent->Items()->Value(i1);
-    SW.Send (Var0.Value());
+  if (!ent->Items().IsNull())
+  {
+    for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) {
+      StepAP214_GroupItem Var0 = ent->Items()->Value(i1);
+      SW.Send (Var0.Value());
+    }
   }
   SW.CloseSub();
 }