mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0029633: Data Exchange - access violation in StepVisual_PresentationStyleAssignment while translating STEP file
Add several checks for null.
This commit is contained in:
parent
bc728d2621
commit
f0bef12142
@ -3415,7 +3415,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
|
|||||||
aDimObj->SetClassOfTolerance(aHolle, aFV, aG);
|
aDimObj->SetClassOfTolerance(aHolle, aFV, aG);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aCRI.IsNull() && aCRI->ItemElement()->Length() > 0)
|
if (!aCRI.IsNull() && !aCRI->ItemElement().IsNull() && aCRI->ItemElement()->Length() > 0)
|
||||||
{
|
{
|
||||||
//get modifiers
|
//get modifiers
|
||||||
XCAFDimTolObjects_DimensionModifiersSequence aModifiers;
|
XCAFDimTolObjects_DimensionModifiersSequence aModifiers;
|
||||||
|
@ -45,5 +45,5 @@ StepVisual_PresentationStyleSelect StepVisual_PresentationStyleAssignment::Style
|
|||||||
|
|
||||||
Standard_Integer StepVisual_PresentationStyleAssignment::NbStyles () const
|
Standard_Integer StepVisual_PresentationStyleAssignment::NbStyles () const
|
||||||
{
|
{
|
||||||
return styles->Length();
|
return (styles.IsNull()) ? 0 : styles->Length();
|
||||||
}
|
}
|
||||||
|
@ -58,5 +58,5 @@ StepVisual_SurfaceStyleElementSelect StepVisual_SurfaceSideStyle::StylesValue(co
|
|||||||
|
|
||||||
Standard_Integer StepVisual_SurfaceSideStyle::NbStyles () const
|
Standard_Integer StepVisual_SurfaceSideStyle::NbStyles () const
|
||||||
{
|
{
|
||||||
return styles->Length();
|
return (styles.IsNull()) ? 0 : styles->Length();
|
||||||
}
|
}
|
||||||
|
19
tests/gdt/export/C3
Normal file
19
tests/gdt/export/C3
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||||
|
set filename bug29633_nist_ctc_05_asme1_ap242-1.stp
|
||||||
|
|
||||||
|
set ref_data {
|
||||||
|
|
||||||
|
NbOfDimensions : 28
|
||||||
|
NbOfDimensionalSize : 1
|
||||||
|
NbOfDimensionalLocation: 5
|
||||||
|
NbOfAngular : 0
|
||||||
|
NbOfWithPath : 0
|
||||||
|
NbOfCommonLabels : 2
|
||||||
|
NbOfTolerances : 10
|
||||||
|
NbOfGTWithModifiers : 0
|
||||||
|
NbOfGTWithMaxTolerance : 0
|
||||||
|
NbOfGTWithDatums : 8
|
||||||
|
NbOfDatumFeature : 2
|
||||||
|
NbOfAttachedDatum : 9
|
||||||
|
NbOfDatumTarget : 0
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user