From: azv Date: Tue, 20 Aug 2019 13:11:00 +0000 (+0300) Subject: Issue #2980: Crash when change sketch plane X-Git-Tag: VEDF2019Lot4~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=505fa84a0c33ac8f869847bfafd661e4b669836d;p=modules%2Fshaper.git Issue #2980: Crash when change sketch plane Avoid crash on Horizontal/Vertical constraint presentation while changing the sketch plane. --- 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; }