From: drazmyslovich Date: Tue, 19 Aug 2014 12:28:48 +0000 (+0200) Subject: 0025168: STEP Writer - empty AppliedGroupAssignment can cause exception in RWStepAP21... X-Git-Tag: V6_8_0_beta~142 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=8a8be2aabe7e6f21acbcbb6398f70bcbfbfb38e9;p=occt.git 0025168: STEP Writer - empty AppliedGroupAssignment can cause exception in RWStepAP214_RWAppliedGroupAssignment class Function WriteStep is fixed --- diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedGroupAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedGroupAssignment.cxx index e70a81f300..18b160eada 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedGroupAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedGroupAssignment.cxx @@ -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(); }