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

0023251: Crash during reading materials from STEP file for case when name of material is not set.

Fix for case when materials in STEP file was written invalid way
This commit is contained in:
gka 2012-07-09 17:52:35 +04:00
parent 8c3c99048d
commit 87073a1017

View File

@ -1928,7 +1928,10 @@ Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_Wor
Handle(StepRepr_DescriptiveRepresentationItem) DRI =
Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(RI);
aName = DRI->Name();
aDescription = DRI->Description();
if(aName.IsNull())
aName = aDescription;
}
if(RI->IsKind(STANDARD_TYPE(StepRepr_MeasureRepresentationItem))) {
// try to find density for material
@ -1960,7 +1963,9 @@ Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_Wor
}
}
}
if( aName->Length()==0 ) continue;
if( aName.IsNull() || aName->Length()==0 )
continue;
// find shape label amd create Material link
TopoDS_Shape aSh;
Handle(StepShape_SolidModel) SM = FindSolidForPDS(PDS,graph);