diff --git a/src/StepShape/StepShape_GeometricSet.cxx b/src/StepShape/StepShape_GeometricSet.cxx index 24e59cbe77..bd76404127 100644 --- a/src/StepShape/StepShape_GeometricSet.cxx +++ b/src/StepShape/StepShape_GeometricSet.cxx @@ -49,5 +49,7 @@ StepShape_GeometricSetSelect StepShape_GeometricSet::ElementsValue(const Standar Standard_Integer StepShape_GeometricSet::NbElements () const { + if (elements.IsNull()) + return 0; return elements->Length(); } diff --git a/tests/bugs/step/bug31675 b/tests/bugs/step/bug31675 new file mode 100644 index 0000000000..294564d600 --- /dev/null +++ b/tests/bugs/step/bug31675 @@ -0,0 +1,16 @@ +puts "====================================" +puts "0031675: Er-ror opening the STEP-file" +puts "====================================" +puts "" + +pload DCAF + +# Read file +ReadStep D [locate_data_file bug31675.stp] +XGetOneShape res D + +# Checking +checknbshapes res -face 1036 -wire 2103 -compound 6 +checkshape res f + +Close D