]> OCCT Git - occt.git/commitdiff
[bos #42181] Fatal error in Fuse selection NCollection_DataMap::Find CR0_fix_selection
authorjfa <jfa@opencascade.com>
Fri, 14 Jun 2024 12:32:10 +0000 (13:32 +0100)
committermzernova <mzernova@opencascade.com>
Mon, 17 Feb 2025 11:49:35 +0000 (11:49 +0000)
src/AIS/AIS_Selection.cxx

index 874ba363bb9795fbb00def92ecece268cc392e53..039f3004caa8fc85ea56073c91284375bf674441 100644 (file)
@@ -65,8 +65,11 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(SelectMgr_EntityOwner)& theO
   const Standard_Boolean wasSelected = theOwner->IsSelected();
   const Standard_Boolean toSelect    = theOwner->Select(theSelScheme, isDetected);
 
-  if (toSelect && !wasSelected)
+  if (!wasSelected || !myResultMap.IsBound(theOwner))
   {
+    if (!toSelect)
+      return AIS_SS_NotDone;
+
     AIS_NListOfEntityOwner::Iterator aListIter;
     myresult.Append(theOwner, aListIter);
     myResultMap.Bind(theOwner, aListIter);
@@ -74,11 +77,6 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(SelectMgr_EntityOwner)& theO
     return AIS_SS_Added;
   }
 
-  if (!toSelect && !wasSelected)
-  {
-    return AIS_SS_NotDone;
-  }
-
   AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find(theOwner);
   if (myIterator == aListIter)
   {