diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index b5099136f3e..947c0c8aeae 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2095,8 +2095,14 @@ private: //------------------------------------------------------- private data std::string off; is >> sm_skip_comments; is >> off; - CGAL_assertion( (off == "OFF") || (off == "COFF") || (off == "NOFF") || (off == "CNOFF")); - + if(! ( + (off == "OFF") || (off == "COFF") || (off == "NOFF") || (off == "CNOFF") + ) + ) + { + is.setstate(std::ios::failbit); + return false; + } is >> n >> f >> e; if(!is){ return false;