From a15340d061d55f860596c8c1303215dfae00d805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 16 Feb 2024 22:45:50 +0100 Subject: [PATCH] Adjust input validity checks --- .../examples/Isosurfacing_3/contouring_mesh_offset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Isosurfacing_3/examples/Isosurfacing_3/contouring_mesh_offset.cpp b/Isosurfacing_3/examples/Isosurfacing_3/contouring_mesh_offset.cpp index 11aa1c6a16e..028030fa09b 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/contouring_mesh_offset.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/contouring_mesh_offset.cpp @@ -126,14 +126,14 @@ int main(int argc, char** argv) const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/cross.off"); const FT offset_value = (argc > 2) ? std::stod(argv[2]) : 0.2; - if(offset_value <= 0) + if(offset_value < 0) { std::cerr << "Offset value must be positive" << std::endl; return EXIT_FAILURE; } Mesh mesh; - if(!CGAL::IO::read_polygon_mesh(filename, mesh)) + if(!CGAL::IO::read_polygon_mesh(filename, mesh) || is_empty(mesh)) { std::cerr << "Could not read input mesh" << std::endl; return EXIT_FAILURE;