caught an exception when ryujinx tries to load non-homebrew as homebrew

This commit is contained in:
Xpl0itR 2019-07-06 14:41:06 +01:00
commit fd5853fc24
No known key found for this signature in database
GPG key ID: 91798184109676AD
2 changed files with 10 additions and 2 deletions

View file

@ -151,7 +151,14 @@ namespace Ryujinx
} }
} }
if ((Path.GetExtension(GamePath) == ".nca") || (Path.GetExtension(GamePath) == ".nro") || (Path.GetExtension(GamePath) == ".nso")) { TitleName = Path.GetFileName(GamePath); } if ((Path.GetExtension(GamePath) == ".nca") || (Path.GetExtension(GamePath) == ".nro") || (Path.GetExtension(GamePath) == ".nso"))
{
StringBuilder titleName = new StringBuilder();
titleName.Append(Path.GetFileName(GamePath));
titleName.Remove(Path.GetFileName(GamePath).Length - Path.GetExtension(GamePath).Length, Path.GetExtension(GamePath).Length);
TitleName = titleName.ToString();
}
else else
{ {
IFile controlFile = controlFs.OpenFile("/control.nacp", OpenMode.Read); IFile controlFile = controlFs.OpenFile("/control.nacp", OpenMode.Read);

View file

@ -225,7 +225,8 @@ namespace Ryujinx
break; break;
default: default:
Logger.PrintInfo(LogClass.Application, "Loading as homebrew."); Logger.PrintInfo(LogClass.Application, "Loading as homebrew.");
_device.LoadProgram(path); try { _device.LoadProgram(path); }
catch (ArgumentOutOfRangeException) { Logger.PrintError(LogClass.Application, $"The file which you have specified is unsupported by Ryujinx"); }
break; break;
} }
} }