]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1948 multiply selection with Shift button pressed does not work
authornds <nds@opencascade.com>
Wed, 5 Apr 2017 12:55:20 +0000 (15:55 +0300)
committernds <nds@opencascade.com>
Wed, 5 Apr 2017 12:55:20 +0000 (15:55 +0300)
Regression correction, selection of dimensions leads to crash.

src/PartSet/PartSet_SketcherMgr.cpp

index 87cbaac301be841ce13169771eea3934ac2e0857..7a9c2c78872af19e2650b8e2404e32920938aac9 100755 (executable)
@@ -1518,8 +1518,14 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature,
   std::list<ResultPtr> aResults = theFeature->results();
   std::list<ResultPtr>::const_iterator aIt;
 
-  const TopoDS_Shape aFirstShape = theFeature->firstResult()->shape()->impl<TopoDS_Shape>();
-  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<TopoDS_Shape>();
+      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>();
+    TopoDS_Shape aFirstShape;
+    ResultPtr aFirstResult = aFeature->firstResult();
+    if (aFirstResult.get() && aFirstResult->shape().get())
+      aFirstShape = aFirstResult->shape()->impl<TopoDS_Shape>();
     anInfo.myFirstResultShape = aFirstShape;
     Handle(SelectMgr_EntityOwner) anOwner = aPrs->owner();
     if (aResult.get()) {