mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Don't error if the a patch's base has no RomFS
This commit is contained in:
parent
6213111af9
commit
e1b9f9b935
1 changed files with 4 additions and 4 deletions
|
@ -140,8 +140,7 @@ namespace LibHac
|
||||||
false);
|
false);
|
||||||
if (BaseNca == null) return rawStream;
|
if (BaseNca == null) return rawStream;
|
||||||
|
|
||||||
Stream baseStream = BaseNca.OpenSection(ProgramPartitionType.Data, true, IntegrityCheckLevel.None);
|
Stream baseStream = BaseNca.OpenSection(ProgramPartitionType.Data, true, IntegrityCheckLevel.None) ?? Stream.Null;
|
||||||
if (baseStream == null) throw new InvalidDataException("Base NCA has no RomFS section");
|
|
||||||
|
|
||||||
return new Bktr(rawStream, baseStream, sect);
|
return new Bktr(rawStream, baseStream, sect);
|
||||||
|
|
||||||
|
@ -162,11 +161,12 @@ namespace LibHac
|
||||||
public Stream OpenSection(int index, bool raw, IntegrityCheckLevel integrityCheckLevel)
|
public Stream OpenSection(int index, bool raw, IntegrityCheckLevel integrityCheckLevel)
|
||||||
{
|
{
|
||||||
Stream rawStream = OpenRawSection(index);
|
Stream rawStream = OpenRawSection(index);
|
||||||
NcaSection sect = Sections[index];
|
|
||||||
NcaFsHeader header = sect.Header;
|
|
||||||
|
|
||||||
if (raw || rawStream == null) return rawStream;
|
if (raw || rawStream == null) return rawStream;
|
||||||
|
|
||||||
|
NcaSection sect = Sections[index];
|
||||||
|
NcaFsHeader header = sect.Header;
|
||||||
|
|
||||||
// If it's a patch section without a base, return the raw section because it has no hash data
|
// If it's a patch section without a base, return the raw section because it has no hash data
|
||||||
if (header.EncryptionType == NcaEncryptionType.AesCtrEx && BaseNca == null) return rawStream;
|
if (header.EncryptionType == NcaEncryptionType.AesCtrEx && BaseNca == null) return rawStream;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue