From: azv Date: Thu, 28 Feb 2019 09:51:35 +0000 (+0300) Subject: Issue #2880: SIGSEGV after undo an arc deletion X-Git-Tag: HighLevelObjectsHierarchy~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13bf3ed561d8d6b91406b44fd6407cd4257741c9;p=modules%2Fshaper.git Issue #2880: SIGSEGV after undo an arc deletion Avoid crash while getting the position of tangency presentation. --- diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp index 167066152..d98ffa0ac 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp @@ -150,14 +150,17 @@ const std::array& SketcherPrs_PositionMgr::getPositionIndex(GeomPointPtr if (aUseFeature) { DataPtr aData = aFeature->data(); AttributeRefAttrPtr aObjRef = aData->refattr(SketchPlugin_Constraint::ENTITY_A()); - FeaturePtr aObj = ModelAPI_Feature::feature(aObjRef->object()); + FeaturePtr aObj; + if (aObjRef) + aObj = ModelAPI_Feature::feature(aObjRef->object()); bool aContains = false; - if (containsPoint(aObj, aPnt2d, thePos)) { + if (aObj && containsPoint(aObj, aPnt2d, thePos)) { aContains = true; } else { aObjRef = aData->refattr(SketchPlugin_Constraint::ENTITY_B()); - aObj = ModelAPI_Feature::feature(aObjRef->object()); - if (containsPoint(aObj, aPnt2d, thePos)) { + if (aObjRef) + aObj = ModelAPI_Feature::feature(aObjRef->object()); + if (aObj && containsPoint(aObj, aPnt2d, thePos)) { aContains = true; } }