From: ikochetkova Date: Tue, 6 May 2025 14:09:21 +0000 (+0100) Subject: WRT02-12: Exceptions during import STEP X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR0-ww-depot-750;p=occt.git WRT02-12: Exceptions during import STEP Add checks for empty and null data. --- diff --git a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx index 4823e4de1d..2d39d4a70d 100644 --- a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx +++ b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx @@ -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; diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx index 32f598f763..35c5d35b8b 100644 --- a/src/STEPControl/STEPControl_ActorRead.cxx +++ b/src/STEPControl/STEPControl_ActorRead.cxx @@ -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 aInfos(1, myShapesToHeal.Size()); NCollection_Array1 aOrigToCopyMapArr(1, myShapesToHeal.Size()); NCollection_Array1 aCopyToOrigMapArr(1, myShapesToHeal.Size());