Salome HOME
IMP23369: [CEA 1513] compute a mesh using an already existing mesh with MG-CADSurf
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index c03faa32c2b81e6ccf0a7ac498abcae7eb26a884..86ae35c5f7aac637fed1d33fe76c7b4f330a9768 100644 (file)
@@ -322,7 +322,7 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
   {
     // define the next tag after given one in the data tree to insert SObject
     SALOMEDS::SObject_wrap curObj, objAfter;
-    if ( theFatherObject->GetLastChildTag() > theTag )
+    if ( theFatherObject->GetLastChildTag() > theTag && theTag > 0 )
     {
       SALOMEDS::UseCaseIterator_wrap
         anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);