Salome HOME
Minor: removing directive after an #endif (triggered a warning)
[modules/med.git] / src / MEDLoader / SauvWriter.cxx
index 0ff5777aa3a41b4f95905b4eee99bcbdb5cf38c8..697847bb6ac05c182b0ec5e941e455053ee61676 100644 (file)
@@ -578,7 +578,16 @@ void SauvWriter::makeProfileIDs( SubMesh*                          sm,
       vector<const DataArrayInt *> idsPerType( 1, profile );
       MEDCouplingAutoRefCountObjectPtr<DataArrayInt>
         resIDs = uMesh->checkTypeConsistencyAndContig( code, idsPerType );
-      ids.assign( resIDs->begin(), resIDs->end() );
+      if (( const DataArrayInt *) resIDs )
+      {
+        ids.assign( resIDs->begin(), resIDs->end() );
+      }
+      else // mesh includes only one type
+      {
+        int nbE = code[1];
+        for ( ids.resize( nbE ); nbE; --nbE )
+          ids[ nbE-1 ] = nbE-1;
+      }
     }
 }