🐛 Fix SSN file reader to allow for non-solidpkg files

This commit is contained in:
C-3PO 2018-06-22 13:36:44 +02:00
parent f2d6f70790
commit 1172d34a2b
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -104,9 +104,6 @@ export default function readSsnFile(buffer: Buffer): ISsnFileEntry[] {
const relOffset = dv.getUint32(pos, true); pos += 4; const relOffset = dv.getUint32(pos, true); pos += 4;
/** file name (variable size) */ /** file name (variable size) */
const fileName = Decoder.decode(new DataView(arrayBuffer, pos, fileNameLength)); pos += fileNameLength; const fileName = Decoder.decode(new DataView(arrayBuffer, pos, fileNameLength)); pos += fileNameLength;
if (fileName !== 'metafile.solid') {
throw new Error(`Expected file name to be "metafile.solid" but it was "${fileName}".`);
}
//read password from extra field //read password from extra field
const extraFieldEnd = pos + extraFieldLength; const extraFieldEnd = pos + extraFieldLength;