caught an exception when ryujinx tries to load non-homebrew as homebrew
This commit is contained in:
parent
504199394f
commit
fd5853fc24
2 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
{
|
||||
IFile controlFile = controlFs.OpenFile("/control.nacp", OpenMode.Read);
|
||||
|
|
|
@ -225,7 +225,8 @@ namespace Ryujinx
|
|||
break;
|
||||
default:
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue