]> OCCT Git - occt-copy.git/commitdiff
0031786: Data Exchange - After the importing STEP file the free shape is empty
authorsshutina <sshutina@opencascade.com>
Fri, 2 Oct 2020 11:31:13 +0000 (14:31 +0300)
committersshutina <sshutina@opencascade.com>
Mon, 15 Feb 2021 10:28:33 +0000 (13:28 +0300)
 - Fixed the exception

(cherry picked from commit e0d75dd7ab4938f9bb15aea1fc75c7f9290ceacb)
(cherry picked from commit 22cf5903afa0d88de856b30fdf9bf836c333951a)

src/STEPCAFControl/STEPCAFControl_Reader.cxx

index 2573a8dc3106b1f562312c0e49ef58ba3ebcb61a..e14a630866ff4cfb6a065efe96fa009e7f52960b 100644 (file)
@@ -4354,8 +4354,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))) {