Check if the desired language is actually available

This commit is contained in:
TSR Berry 2023-04-02 22:24:20 +02:00
parent cf74740f82
commit 47ffa43ea1
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2

View file

@ -52,7 +52,17 @@ namespace Ryujinx.HLE.Loaders.Processes
{
ulong programId = metaLoader.GetProgramId();
Name = ApplicationControlProperties.Title[(int)titleLanguage].NameString.ToString();
if (ApplicationControlProperties.Title.ItemsRo.Length > 0)
{
var langIndex = ApplicationControlProperties.Title.ItemsRo.Length > (int)titleLanguage ? (int)titleLanguage : 0;
Name = ApplicationControlProperties.Title[langIndex].NameString.ToString();
}
else
{
Name = metaLoader.GetProgramName();
}
ProgramId = programId;
ProgramIdText = $"{programId:x16}";
Is64Bit = metaLoader.IsProgram64Bit();