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

index b0acb5ffa1b0ffc5b0b75ce596d47e7281dc9ccd..e797a7157a814c30678ea63dc849459af6352393 100644 (file)
@@ -72,8 +72,11 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
   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);
@@ -81,11 +84,6 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
     return AIS_SS_Added;
   }
 
-  if (!toSelect && !wasSelected)
-  {
-    return AIS_SS_NotDone;
-  }
-
   AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theOwner);
   if (myIterator == aListIter)
   {