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<const SMDS_MeshNode*> (it->next());
+ if ( ind >= 0 ) {
+ SMDS_ElemIteratorPtr it = nodesIterator();
+ for ( int i = 0; i < ind; ++i )
+ it->next();
+ if ( it->more() )
+ return static_cast<const SMDS_MeshNode*> (it->next());
+ }
return 0;
}