From 505fa84a0c33ac8f869847bfafd661e4b669836d Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 20 Aug 2019 16:11:00 +0300 Subject: [PATCH] Issue #2980: Crash when change sketch plane Avoid crash on Horizontal/Vertical constraint presentation while changing the sketch plane. --- src/SketcherPrs/SketcherPrs_HVDirection.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.cpp b/src/SketcherPrs/SketcherPrs_HVDirection.cpp index 942bd909e..336f298b2 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.cpp +++ b/src/SketcherPrs/SketcherPrs_HVDirection.cpp @@ -39,13 +39,14 @@ SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint } bool SketcherPrs_HVDirection::IsReadyToDisplay(ModelAPI_Feature* theConstraint, - const std::shared_ptr&/* thePlane*/) + const std::shared_ptr& thePlane) { bool aReadyToDisplay = false; - ObjectPtr aObj = - SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - - aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL; + if (thePlane.get()) { + ObjectPtr aObj = + SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); + aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL; + } return aReadyToDisplay; } -- 2.39.2