Unlinker: Check if a file exists before attempting to load it

This commit is contained in:
Jan 2020-02-04 19:44:30 +01:00
parent dde77901a3
commit 10342a7b58

View File

@ -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);