0025168: STEP Writer - empty AppliedGroupAssignment can cause exception in RWStepAP21...
[occt.git] / 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();
 }