Skip non-existent files and bad symlinks when loading applications

This commit is contained in:
TSR Berry 2024-08-02 00:20:30 +02:00
parent 62f64a2cb7
commit 90442c9dbf
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2

View file

@ -537,10 +537,18 @@ namespace Ryujinx.UI.App.Common
}
var fileInfo = new FileInfo(app);
var fullPath = fileInfo.ResolveLinkTarget(true)?.FullName ?? fileInfo.FullName;
applicationPaths.Add(fullPath);
numApplicationsFound++;
try
{
var fullPath = fileInfo.ResolveLinkTarget(true)?.FullName ?? fileInfo.FullName;
applicationPaths.Add(fullPath);
numApplicationsFound++;
}
catch (IOException exception)
{
Logger.Warning?.Print(LogClass.Application, $"Failed to resolve the full path to file: \"{app}\" Error: {exception}");
}
}
}
catch (UnauthorizedAccessException)