From 6ab2c815b43166dc7cacb0366e05563ce2aef96d Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 19 Jan 2017 15:04:41 +0300 Subject: [PATCH] Issue #2005: Application crashes when loading python script for guitar Fixed crash. --- src/SketchAPI/SketchAPI_Projection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SketchAPI/SketchAPI_Projection.cpp b/src/SketchAPI/SketchAPI_Projection.cpp index d67149d02..584fa6751 100644 --- a/src/SketchAPI/SketchAPI_Projection.cpp +++ b/src/SketchAPI/SketchAPI_Projection.cpp @@ -71,8 +71,12 @@ std::shared_ptr SketchAPI_Projection::createdFeature() c { AttributeRefAttrPtr aProjectedRefAttr = projectedFeature(); FeaturePtr aProjectedFeature = ModelAPI_Feature::feature(aProjectedRefAttr->object()); - std::shared_ptr anEntity; + + if(!aProjectedFeature.get()) { + return anEntity; + } + aProjectedFeature->getKind() == SketchPlugin_Line::ID() ? anEntity.reset(new SketchAPI_Line(aProjectedFeature)) : aProjectedFeature->getKind() == SketchPlugin_Circle::ID() ? -- 2.39.2