Add checking for null name and null id
Adding of test cases for CR23736
if ( PDR.IsNull() ) continue;
if ( PDR->HasDescription() &&
PDR->Description()->Length() >0 ) name = PDR->Description();
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 );
}
// find proper label
L = FindInstance ( NAUO, STool, Tool, PDFileMap, ShapeLabelMap );
Handle(StepBasic_ProductDefinition)::DownCast(enti);
if(PD.IsNull()) continue;
Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
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() );
L = GetLabelFromPD ( PD, STool, TP, PDFileMap, ShapeLabelMap );
if ( L.IsNull() ) continue;
TCollection_ExtendedString str ( name->String() );
--- /dev/null
+puts "============"
+puts "CR23736"
+puts "============"
+puts ""
+######################################################
+# Exeption during reading STEP file in Test Harness
+######################################################
+
+pload DCAF
+
+NewDocument D MDTV-XCAF
+UndoLimit D 100
+NewCommand D
+
+ReadStep D [locate_data_file mat.stp]