1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0026451: Crash importing STeP file

Add check for NULL.
This commit is contained in:
ika 2015-11-06 11:47:53 +03:00 committed by bugmaster
parent b128c89231
commit 5371131494
2 changed files with 3 additions and 1 deletions

View File

@ -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();

View File

@ -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());
}