Salome HOME
Constriction type for all sketch entities
[modules/shaper.git] / src / SketchSolver / SketchSolver_Constraint.cpp
index caccc5223b1303460ed3fd6dd265e4cd728c4c9c..61a42b64cf43195b46d9b6bb549cffc78040aa83 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:    SketchSolver_Constraint.cpp
 // Created: 27 May 2014
 // Author:  Artem ZHIDKOV
@@ -227,11 +229,13 @@ AttrType typeOfAttribute(std::shared_ptr<ModelAPI_Attribute> theAttribute)
         return ARC;
     }
   } else {
-    const std::string aType = anAttrRef->attr()->attributeType();
-    if (aType == GeomDataAPI_Point2D::type())
-      return POINT2D;
-    if (aType == GeomDataAPI_Point2D::type())
-      return POINT2D;
+    if (anAttrRef->attr().get() != NULL) {
+      const std::string aType = anAttrRef->attr()->attributeType();
+      if (aType == GeomDataAPI_Point2D::type())
+        return POINT2D;
+      if (aType == GeomDataAPI_Point2D::type())
+        return POINT2D;
+    }
   }
 
   return UNKNOWN;