X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshElement.cxx;h=a24cbff94b6512aeed6dc066cbb171e3f0c5707d;hb=a269dcbbdfa2b052e6f330c7cf51f2b0580e316f;hp=646f92d10cf6de7901a1d3c1dabb7f067c8d6e9a;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_MeshElement.cxx b/src/SMDS/SMDS_MeshElement.cxx index 646f92d10..a24cbff94 100644 --- a/src/SMDS/SMDS_MeshElement.cxx +++ b/src/SMDS/SMDS_MeshElement.cxx @@ -202,12 +202,13 @@ bool SMDS_MeshElement::IsValidIndex(const int ind) const const SMDS_MeshNode* SMDS_MeshElement::GetNode(const int ind) const { - SMDS_ElemIteratorPtr it = nodesIterator(); - int i = 0, index = WrappedIndex( ind ); - while ( index != i++ ) - it->next(); - if ( it->more() ) - return static_cast (it->next()); + if ( ind >= 0 ) { + SMDS_ElemIteratorPtr it = nodesIterator(); + for ( int i = 0; i < ind; ++i ) + it->next(); + if ( it->more() ) + return static_cast (it->next()); + } return 0; }