diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index eb88fd3f55..06c7befa6f 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -4421,8 +4421,10 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes for (; anIter.More(); anIter.Next()) { if (anIter.Value()->IsKind(STANDARD_TYPE(StepRepr_MappedItem))) { Handle(StepRepr_MappedItem) anItem = Handle(StepRepr_MappedItem)::DownCast(anIter.Value()); - Handle(StepRepr_Representation) aRepr = anItem->MappingSource()->MappedRepresentation(); - collectViewShapes(theWS, theDoc, aRepr, aShapes); + if (Handle(StepRepr_Representation) aRepr = anItem->MappingSource()->MappedRepresentation()) + { + collectViewShapes(theWS, theDoc, aRepr, aShapes); + } } else if (anIter.Value()->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)) || anIter.Value()->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) { diff --git a/tests/bugs/step/bug31786 b/tests/bugs/step/bug31786 new file mode 100644 index 0000000000..d40daeaef6 --- /dev/null +++ b/tests/bugs/step/bug31786 @@ -0,0 +1,15 @@ +puts "=======" +puts "0031786: Data Exchange - After the importing STEP file the free shape is empty" +puts "=======" +puts "" + +pload ALL + +ReadStep D [locate_data_file bug31786_InternalUseOnly_714-236074-105_NXMBD_A_PNL_SIDE_ENCL_AC_DC_242.stp] +XGetOneShape result D + +vinit +vdisplay result +vfit + +vdump $imagedir/${casename}.png \ No newline at end of file