From: dpasukhi Date: Mon, 29 Nov 2021 08:36:21 +0000 (+0300) Subject: 0031786: Data Exchange - After the importing STEP file the free shape is empty X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c6e707147fe7b4c157ee4ecd987b83a1f7b53c39;p=occt.git 0031786: Data Exchange - After the importing STEP file the free shape is empty Fixed throwing an exception when the relation to read views is incorrect --- diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index 49c0472ba6..d08ff63f1a 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -4293,8 +4293,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))) {