🐛 Check for error after zlib uncompression

This commit is contained in:
C-3PO 2018-06-23 22:48:17 +02:00
parent f40a097b81
commit 523f306ab3
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

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