From 98b9f7a1a7eeaa3b6495a1bb3b88309aee7f49de Mon Sep 17 00:00:00 2001 From: vimene Date: Sat, 13 Dec 2025 16:07:53 +0100 Subject: check if file exists in obj_parser.cpp --- src/obj_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/obj_parser.cpp') diff --git a/src/obj_parser.cpp b/src/obj_parser.cpp index 196261e..b30eff1 100644 --- a/src/obj_parser.cpp +++ b/src/obj_parser.cpp @@ -92,6 +92,10 @@ float parse_int(const std::string& s) { o3d::Mesh parse_object(const std::string& obj_path) { o3d::Mesh mesh; std::ifstream obj_file(obj_path); + if (!obj_file.is_open()) { + std::cerr << "file `" << obj_path << "'not found" << std::endl; // TODO: improve + std::exit(1); + } std::string line; while (std::getline(obj_file, line)) { if (line.length() == 0 || line[0] == '#') -- cgit v1.2.3