Salome HOME
updated copyright message
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_Validators.cpp
index 2a96b71f07fe4a1cd48da155fbd6b21d371d33ba..3fd3e1f320805f5f53915cb406017b23eab31424 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -115,7 +115,9 @@ bool CollectionPlugin_GroupSelectionValidator::isValid(
 
   for (int anIndex = 0; anIndex < aSelList->size(); ++anIndex) {
     AttributeSelectionPtr aCurSelection = aSelList->value(anIndex);
-    ResultPtr aGroupResult = aCurSelection->context();
+    FeaturePtr aCurFeature = aCurSelection->contextFeature();
+    ResultPtr aGroupResult = aCurFeature.get() ? aCurFeature->lastResult()
+                                               : aCurSelection->context();
     if (!aGroupResult.get() || aGroupResult->groupName() == ModelAPI_ResultGroup::group()) {
       theError = "Error: Whole group mustn't be selected.";
       return false;