From b98a27bcc6f10bf181ecc0ce98b10a3f794f726c Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 5 Apr 2017 15:55:20 +0300 Subject: [PATCH] Issue #1948 multiply selection with Shift button pressed does not work Regression correction, selection of dimensions leads to crash. --- src/PartSet/PartSet_SketcherMgr.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 87cbaac30..7a9c2c788 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -1518,8 +1518,14 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, std::list aResults = theFeature->results(); std::list::const_iterator aIt; - const TopoDS_Shape aFirstShape = theFeature->firstResult()->shape()->impl(); - bool isSameShape = aFirstShape.IsEqual(anInfo.myFirstResultShape); + bool isSameShape = false; + if (aResults.size() > 0) { + ResultPtr aFirstResult = theFeature->firstResult(); + if (aFirstResult.get() && aFirstResult->shape().get()) { + const TopoDS_Shape& aFirstShape = aFirstResult->shape()->impl(); + isSameShape = aFirstShape.IsEqual(anInfo.myFirstResultShape); + } + } for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { ResultPtr aResult = *aIt; AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult); @@ -1730,7 +1736,10 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) if (myCurrentSelection.find(aFeature) != myCurrentSelection.end()) anInfo = myCurrentSelection.find(aFeature).value(); - const TopoDS_Shape aFirstShape = aFeature->firstResult()->shape()->impl(); + TopoDS_Shape aFirstShape; + ResultPtr aFirstResult = aFeature->firstResult(); + if (aFirstResult.get() && aFirstResult->shape().get()) + aFirstShape = aFirstResult->shape()->impl(); anInfo.myFirstResultShape = aFirstShape; Handle(SelectMgr_EntityOwner) anOwner = aPrs->owner(); if (aResult.get()) { -- 2.39.2