Salome HOME
bos #29332 [CEA 26899] GroupOnGeom returns None
[modules/geom.git] / src / GEOMClient / GEOM_Client.cxx
index d9796231422eabaf100851c864b9fc6f1f86f0b1..871cd861a93274e97ebe3191cd97bef9ce16bba1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -254,8 +254,10 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
     subShapes.insert( subShapes.end(), anIndices.cbegin(), anIndices.cend() );
   }
 
-  /* Case of only one subshape */
-  if ( list->length() == 1 && list[0] > 1 ) {
+  /* Case of only one subshape, excluding groups of one main shape */
+  if ( list->length() == 1 &&
+       !(aShape->GetType() == 37 && list[0] == 1) &&
+       list[0] > 0 ) {
     S = subShapes[list[0]-1];
   }
   else {