diff --git a/src/StepToGeom/StepToGeom_MakeCurve.cxx b/src/StepToGeom/StepToGeom_MakeCurve.cxx index 47daa5a039..889a26b117 100755 --- a/src/StepToGeom/StepToGeom_MakeCurve.cxx +++ b/src/StepToGeom/StepToGeom_MakeCurve.cxx @@ -52,6 +52,9 @@ Standard_Boolean StepToGeom_MakeCurve::Convert (const Handle(StepGeom_Curve)& SC, Handle(Geom_Curve)& CC) { + if (SC.IsNull()){ + return Standard_False; + } if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) { const Handle(StepGeom_Line) L = Handle(StepGeom_Line)::DownCast(SC); return StepToGeom_MakeLine::Convert(L,*((Handle(Geom_Line)*)&CC)); diff --git a/tests/bugs/grids.list b/tests/bugs/grids.list index aa4e4efb51..7f4041bbce 100755 --- a/tests/bugs/grids.list +++ b/tests/bugs/grids.list @@ -5,5 +5,5 @@ 005 xde 006 modalg 007 moddata - +008 step diff --git a/tests/bugs/step/begin b/tests/bugs/step/begin new file mode 100755 index 0000000000..548d4d3146 --- /dev/null +++ b/tests/bugs/step/begin @@ -0,0 +1,9 @@ +pload XDE + + + + + + + + diff --git a/tests/bugs/step/bug22871 b/tests/bugs/step/bug22871 new file mode 100755 index 0000000000..a44050db99 --- /dev/null +++ b/tests/bugs/step/bug22871 @@ -0,0 +1,15 @@ +puts "============" +puts "CR22871" +puts "============" +puts "" +####################################################################### +# Step Reader raises exception on invalid entity (null swept curve) +####################################################################### + +set info [stepread [locate_data_file bug22871_null-swept-curve.stp] s *] +set check [lsearch $info Exception*] +if { $check != -1 } { + puts "Error : Step Reader raises exception" +} + +