Salome HOME
Merge branch 'V9_9_BR'
[modules/shaper.git] / src / FiltersPlugin / FiltersPlugin_OnGeometry.cpp
index c7fa73d32aa2516a475566fe54ffa27a892928af..d234e4f8ec2114c07732fe99d00d3fb5ee47f1bb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -35,9 +35,11 @@ bool FiltersPlugin_OnGeometry::isOk(const GeomShapePtr& theShape, const ResultPt
   if (!aList.get())
     return false;
   for (int i = 0; i < aList->size(); i++) {
-    AttributeSelectionPtr aAttr = aList->value(i);
-    GeomShapePtr aGeom = aAttr->value();
-    if (aGeom->isSameGeometry(theShape))
+    AttributeSelectionPtr aCurAttr = aList->value(i);
+    GeomShapePtr aGeom = aCurAttr->value();
+    if (!aGeom)
+      aGeom = aCurAttr->context()->shape();
+    if (aGeom && aGeom->isSameGeometry(theShape))
       return true;
   }
   return false;