]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix crash in constraint creation.
authorazv <azv@opencascade.com>
Thu, 24 Dec 2015 05:36:37 +0000 (08:36 +0300)
committerazv <azv@opencascade.com>
Thu, 24 Dec 2015 05:36:37 +0000 (08:36 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp

index 9d7d63f2f5ddbde47f0c4a2e0bac07a92e1fc0e1..7d9911b915e2ca38778d2a1954aaccc5d2644495 100644 (file)
@@ -185,10 +185,10 @@ std::list<ConstraintWrapperPtr> PlaneGCSSolver_Builder::createConstraint(
   ParameterWrapperPtr anIntermediate;
 
   std::shared_ptr<PlaneGCSSolver_PointWrapper> aPoint1 = GCS_POINT_WRAPPER(thePoint1);
-  if (!aPoint1 && thePoint1->type() == ENTITY_POINT)
+  if (!aPoint1 && thePoint1 && thePoint1->type() == ENTITY_POINT)
     aPoint1 = GCS_POINT_WRAPPER( GCS_ENTITY_WRAPPER(thePoint1)->subEntities().front() );
   std::shared_ptr<PlaneGCSSolver_PointWrapper> aPoint2 = GCS_POINT_WRAPPER(thePoint2);
-  if (!aPoint2 && thePoint2->type() == ENTITY_POINT)
+  if (!aPoint2 && thePoint2 && thePoint2->type() == ENTITY_POINT)
     aPoint2 = GCS_POINT_WRAPPER( GCS_ENTITY_WRAPPER(thePoint2)->subEntities().front() );
 
   switch (theType) {