]> OCCT Git - occt.git/commitdiff
WRT02-12: Exceptions during import STEP CR0-ww-depot-750
authorikochetkova <irina.kochetkova@opencascade.com>
Tue, 6 May 2025 14:09:21 +0000 (15:09 +0100)
committerikochetkova <irina.kochetkova@opencascade.com>
Tue, 6 May 2025 14:09:21 +0000 (15:09 +0100)
Add checks for empty and null data.

src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx
src/STEPControl/STEPControl_ActorRead.cxx

index 4823e4de1d884296a8a0149941d3a9af30d8b9f3..2d39d4a70d6edaac231bbed9c743a07784531f58 100644 (file)
@@ -191,8 +191,12 @@ void STEPCAFControl_GDTProperty::GetDimClassOfTolerance(const Handle(StepShape_L
                                    XCAFDimTolObjects_DimensionFormVariance& theFV,
                                    XCAFDimTolObjects_DimensionGrade& theG)
 {
-  Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance();
-  Handle(TCollection_HAsciiString) aGrade = theLAF->Grade();
+  Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance().IsNull() ?
+                                            new TCollection_HAsciiString() :
+                                            theLAF->FormVariance();
+  Handle(TCollection_HAsciiString) aGrade = theLAF->Grade().IsNull() ?
+                                            new TCollection_HAsciiString() :
+                                            theLAF->Grade();
   theFV = XCAFDimTolObjects_DimensionFormVariance_None;
   Standard_Boolean aFound;
   theHolle = Standard_False;
index 32f598f763709b4187304cb15da66b143f7f3046..35c5d35b8bd6c98f19faf1d8eb55f0254456b641 100644 (file)
@@ -2056,6 +2056,8 @@ void STEPControl_ActorRead::computeIDEASClosings(const TopoDS_Compound& comp,
 //=======================================================================
 Standard_EXPORT void STEPControl_ActorRead::PostHealing(const Handle(Transfer_TransientProcess)& TP)
 {
+  if (myShapesToHeal.IsEmpty())
+    return;
   NCollection_Array1<Handle(ShapeProcess_ShapeContext)> aInfos(1, myShapesToHeal.Size());
   NCollection_Array1<TopTools_DataMapOfShapeShape> aOrigToCopyMapArr(1, myShapesToHeal.Size());
   NCollection_Array1<TopTools_DataMapOfShapeShape> aCopyToOrigMapArr(1, myShapesToHeal.Size());