From 000f6cdc16eea7add70f41124dfeaaa61295c2df Mon Sep 17 00:00:00 2001 From: Cyber Gsus Date: Thu, 10 Jun 2021 13:47:43 +0200 Subject: [PATCH] Fixed bug in RWProxy Decompressing the object now only ocurrs if the file was found, as if the file isn't found the object that is returned doesn't need any decompression (which is the whole point of this PR). --- src/js/core/read_write_proxy.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/js/core/read_write_proxy.js b/src/js/core/read_write_proxy.js index 2f1b8f1e..d12a7780 100644 --- a/src/js/core/read_write_proxy.js +++ b/src/js/core/read_write_proxy.js @@ -329,14 +329,11 @@ export class ReadWriteProxy { .readFileAsync(this.filename) // Decrypt data (if its encrypted) // @ts-ignore - .then(rawData => tryDecompress(rawData).then(verifyChecksum).then(tryParseJSON)) + .then(rawData => tryDecompress(rawData).then(verifyChecksum).then(tryParseJSON).then(decompressObject)) // Check for errors during read .catch(onReadError) - // Decompress - .then(decompressObject) - // Verify basic structure .then(verifyBasicStructure)