ava: Fix crash when extracting sections from NCA with no data section (#5002)

Tested against Omega Strickers.
This commit is contained in:
Mary 2023-05-17 21:27:49 +02:00 committed by Matt Heins
parent ed11a0534e
commit 30c80f253a

View file

@ -193,7 +193,7 @@ namespace Ryujinx.Ava.Common
if (nca.Header.ContentType == NcaContentType.Program)
{
int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
if (nca.Header.GetFsHeader(dataIndex).IsPatchSection())
if (nca.SectionExists(NcaSectionType.Data) && nca.Header.GetFsHeader(dataIndex).IsPatchSection())
{
patchNca = nca;
}