Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMDS / SMDS_MeshGroup.cxx
index adbde5081d5613c7b2afe9fadfcd529120272b9a..e003c9219d25d559edd4428937abfaaaa8785eb7 100644 (file)
@@ -124,8 +124,10 @@ void SMDS_MeshGroup::Add(const SMDS_MeshElement * theElem)
 {
        // the type of the group is determined by the first element added
        if (myElements.empty()) myType = theElem->GetType();
 {
        // the type of the group is determined by the first element added
        if (myElements.empty()) myType = theElem->GetType();
-       else if (theElem->GetType() != myType)
+       else if (theElem->GetType() != myType) {
          MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
          MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
+         return;
+       }
        
        myElements.insert(theElem);
 }
        
        myElements.insert(theElem);
 }