]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2005: Application crashes when loading python script for guitar
authordbv <dbv@opencascade.com>
Thu, 19 Jan 2017 12:04:41 +0000 (15:04 +0300)
committerdbv <dbv@opencascade.com>
Thu, 19 Jan 2017 12:05:12 +0000 (15:05 +0300)
Fixed crash.

src/SketchAPI/SketchAPI_Projection.cpp

index d67149d0282a9b9dbb21254092169e4cf08b331d..584fa67512dd132b4c7a0e174abe5b7c5a2bacbc 100644 (file)
@@ -71,8 +71,12 @@ std::shared_ptr<SketchAPI_SketchEntity> SketchAPI_Projection::createdFeature() c
 {
   AttributeRefAttrPtr aProjectedRefAttr = projectedFeature();
   FeaturePtr aProjectedFeature = ModelAPI_Feature::feature(aProjectedRefAttr->object());
-
   std::shared_ptr<SketchAPI_SketchEntity> anEntity;
+
+  if(!aProjectedFeature.get()) {
+    return anEntity;
+  }
+
   aProjectedFeature->getKind() == SketchPlugin_Line::ID() ?
     anEntity.reset(new SketchAPI_Line(aProjectedFeature)) :
     aProjectedFeature->getKind() == SketchPlugin_Circle::ID() ?