From 10342a7b584bf2aa56a58ab97f3428f06f737c75 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 4 Feb 2020 19:44:30 +0100 Subject: [PATCH] Unlinker: Check if a file exists before attempting to load it --- src/Unlinker/Unlinker.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Unlinker/Unlinker.cpp b/src/Unlinker/Unlinker.cpp index 80048369..557b54b2 100644 --- a/src/Unlinker/Unlinker.cpp +++ b/src/Unlinker/Unlinker.cpp @@ -391,6 +391,13 @@ public: for (unsigned argIndex = 1; argIndex < argCount; argIndex++) { const std::string& zonePath = arguments[argIndex]; + + if(!FileAPI::FileExists(zonePath)) + { + printf("Could not find file \"%s\".\n", zonePath.c_str()); + continue; + } + std::string absoluteZoneDirectory = absolute(std::filesystem::path(zonePath).remove_filename()).string(); SearchPaths searchPathsForZone = GetSearchPathsForZone(absoluteZoneDirectory);