1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023736: Exeption during reading STEP file in Test Harness

Add checking for null name and null id
Adding of test cases for CR23736
This commit is contained in:
ika
2013-02-08 14:50:50 +04:00
parent 92f122144f
commit ab4a555430
2 changed files with 21 additions and 4 deletions

View File

@@ -1069,8 +1069,9 @@ Standard_Boolean STEPCAFControl_Reader::ReadNames (const Handle(XSControl_WorkSe
if ( PDR.IsNull() ) continue;
if ( PDR->HasDescription() &&
PDR->Description()->Length() >0 ) name = PDR->Description();
else if ( PDR->Name()->Length() >0 ) name = PDR->Name();
else name = PDR->Id();
else if ( !PDR->Name().IsNull() && PDR->Name()->Length() >0 ) name = PDR->Name();
else if ( !PDR->Id().IsNull()) name = PDR->Id();
else name = new TCollection_HAsciiString;
}
// find proper label
L = FindInstance ( NAUO, STool, Tool, PDFileMap, ShapeLabelMap );
@@ -1086,8 +1087,9 @@ Standard_Boolean STEPCAFControl_Reader::ReadNames (const Handle(XSControl_WorkSe
Handle(StepBasic_ProductDefinition)::DownCast(enti);
if(PD.IsNull()) continue;
Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
if(Prod->Name()->UsefullLength()>0) name = Prod->Name();
else name = Prod->Id();
if(!Prod->Name().IsNull() && Prod->Name()->UsefullLength()>0) name = Prod->Name();
else if (!Prod->Id().IsNull()) name = Prod->Id();
else name = new TCollection_HAsciiString;
L = GetLabelFromPD ( PD, STool, TP, PDFileMap, ShapeLabelMap );
if ( L.IsNull() ) continue;
TCollection_ExtendedString str ( name->String() );