Catch FileNotFoundException in TryGetApplicationsFromFile()

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

View file

@ -266,8 +266,18 @@ namespace Ryujinx.UI.App.Common
public bool TryGetApplicationsFromFile(string applicationPath, out List<ApplicationData> applications)
{
applications = [];
long fileSize;
long fileSize = new FileInfo(applicationPath).Length;
try
{
fileSize = new FileInfo(applicationPath).Length;
}
catch (FileNotFoundException)
{
Logger.Warning?.Print(LogClass.Application, $"The file was not found: '{applicationPath}'");
return false;
}
BlitStruct<ApplicationControlProperty> controlHolder = new(1);