]> OCCT Git - occt.git/commitdiff
0031786: Data Exchange - After the importing STEP file the free shape is empty CR31786_CR0-ww-depot
authordpasukhi <dpasukhi@opencascade.com>
Mon, 29 Nov 2021 08:36:21 +0000 (11:36 +0300)
committerdpasukhi <dpasukhi@opencascade.com>
Mon, 29 Nov 2021 08:36:21 +0000 (11:36 +0300)
Fixed throwing an exception when the relation to read views is incorrect

src/STEPCAFControl/STEPCAFControl_Reader.cxx

index 49c0472ba6de420177a29f7616fc5d53631cb0d0..d08ff63f1a4c8ff13df0017135f40baa4defeec0 100644 (file)
@@ -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))) {