From 8b6cc9cd98722c89c1b31f4c85163a91bf116703 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 14 Jun 2023 12:30:55 +0100 Subject: [PATCH] Fix imports --- packages/backend-core/src/security/encryption.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/src/security/encryption.ts b/packages/backend-core/src/security/encryption.ts index acfa6616bd..7a8cfaf04a 100644 --- a/packages/backend-core/src/security/encryption.ts +++ b/packages/backend-core/src/security/encryption.ts @@ -125,11 +125,16 @@ export async function decryptFile( inputFile.pipe(decipher).pipe(unzip).pipe(outputFile) return new Promise((res, rej) => { - inputFile.on("finish", () => { + outputFile.on("finish", () => { outputFile.close() res() }) + inputFile.on("error", e => { + outputFile.close() + rej(e) + }) + decipher.on("error", e => { outputFile.close() rej(e) @@ -139,6 +144,11 @@ export async function decryptFile( outputFile.close() rej(e) }) + + outputFile.on("error", e => { + outputFile.close() + rej(e) + }) }) }