Fix crash when following symlinks to nonexistent IWAD files

This commit is contained in:
Cacodemon345 2021-02-12 00:10:05 +06:00 committed by Christoph Oelckers
parent 6bc82bdeff
commit 0a30c19138

View file

@ -577,6 +577,12 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
// -iwad not found or not specified. Revert back to standard behavior.
if (mFoundWads.Size() == numFoundWads) iwadparm = nullptr;
// Check for symbolic links leading to non-existent files.
for (unsigned int i = 0; i < mFoundWads.Size(); i++)
{
if (!FileExists(mFoundWads[i].mFullPath)) mFoundWads.Delete(i);
}
// Now check if what got collected actually is an IWAD.
ValidateIWADs();