Salome HOME
#16648 [CEA] RadialQuadrangle algorithm hypothesis change requires a Clear Mesh Data...
[modules/smesh.git] / src / SMDS / SMDS_MeshCell.cxx
index 25c2f367a4d7c58b4e798778d8d40789666c79c5..60f2a6fa9faf50cd827267a99940b26845bfece2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -639,6 +639,9 @@ const SMDS_MeshNode* SMDS_MeshCell::GetNode(const int ind) const
 
 int SMDS_MeshCell::GetNodeIndex( const SMDS_MeshNode* node ) const
 {
+  if ( !node || node->IsNull() )
+    return -1;
+
   if ( GetVtkType() == VTK_POLYHEDRON )
     return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNodeIndex( node );