diff --git a/src/STEPConstruct/STEPConstruct_Styles.cxx b/src/STEPConstruct/STEPConstruct_Styles.cxx index 4dfe51c818..ad131f96c0 100644 --- a/src/STEPConstruct/STEPConstruct_Styles.cxx +++ b/src/STEPConstruct/STEPConstruct_Styles.cxx @@ -575,6 +575,8 @@ Standard_Boolean STEPConstruct_Styles::GetColors (const Handle(StepVisual_Styled Handle(StepVisual_SurfaceStyleFillArea) SSFA = SSES.SurfaceStyleFillArea(); if ( !SSFA.IsNull() ) { Handle(StepVisual_FillAreaStyle) FAS = SSFA->FillArea(); + if (FAS.IsNull()) + continue; for ( Standard_Integer m=1; m <= FAS->NbFillStyles(); m++ ) { StepVisual_FillStyleSelect FSS = FAS->FillStylesValue ( m ); Handle(StepVisual_FillAreaStyleColour) FASC = FSS.FillAreaStyleColour(); diff --git a/src/StepVisual/StepVisual_FillAreaStyle.cxx b/src/StepVisual/StepVisual_FillAreaStyle.cxx index fea1068635..43d5391301 100644 --- a/src/StepVisual/StepVisual_FillAreaStyle.cxx +++ b/src/StepVisual/StepVisual_FillAreaStyle.cxx @@ -56,5 +56,5 @@ StepVisual_FillStyleSelect StepVisual_FillAreaStyle::FillStylesValue(const Stand Standard_Integer StepVisual_FillAreaStyle::NbFillStyles () const { - return fillStyles->Length(); + return (fillStyles.IsNull() ? 0 : fillStyles->Length()); }