diff --git a/runtime/Sources/Core/Bridge.cpp b/runtime/Sources/Core/Bridge.cpp index 4dfed77..b2e7560 100644 --- a/runtime/Sources/Core/Bridge.cpp +++ b/runtime/Sources/Core/Bridge.cpp @@ -304,6 +304,11 @@ extern "C" mlx::Error("Font loader: filepath is NULL"); return; } + if (!std::filesystem::exists(filepath)) + { + mlx::Error("TTF loader: unable to find file '%'", filepath); + return; + } std::filesystem::path file(filepath); if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte") { @@ -324,6 +329,11 @@ extern "C" mlx::Error("Font loader: filepath is NULL"); return; } + if (!std::filesystem::exists(filepath)) + { + mlx::Error("TTF loader: unable to find file '%'", filepath); + return; + } std::filesystem::path file(filepath); if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte") {