1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

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).
This commit is contained in:
Cyber Gsus 2021-06-10 13:47:43 +02:00
parent 9cd8cbf42c
commit 000f6cdc16

View File

@ -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)