From ec07b77c45a4574e91587c02737af8eff150f2b3 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 24 Dec 2015 08:36:37 +0300 Subject: [PATCH] Fix crash in constraint creation. --- src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp index 9d7d63f2f..7d9911b91 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp @@ -185,10 +185,10 @@ std::list PlaneGCSSolver_Builder::createConstraint( ParameterWrapperPtr anIntermediate; std::shared_ptr 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 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) { -- 2.39.2