diff --git a/src/ssn/extractFile.ts b/src/ssn/extractFile.ts index e96fda5..b52382f 100644 --- a/src/ssn/extractFile.ts +++ b/src/ssn/extractFile.ts @@ -61,8 +61,11 @@ export default async function extractFile(file: ISsnFileEntry, dvArray: DataView } //uncompress file - const uncompressedBuffer: Buffer = await new Promise((resolve) => { + const uncompressedBuffer: Buffer = await new Promise((resolve, reject) => { zlib.inflateRaw(dvFinal, (error, result) => { + if (error !== null) { + reject(error); + } resolve(result); }); }) as Buffer;