From 4a7fdd5f6f03d6fc251e639430e447f8180975d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Mora?= Date: Tue, 26 Feb 2019 14:30:26 +0100 Subject: [PATCH] Fixing a bug where the file is not copied for analyse if the acceptedMimeType option is not present --- src/reporting.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/reporting.js b/src/reporting.js index cd8c5bb..46833ad 100644 --- a/src/reporting.js +++ b/src/reporting.js @@ -293,12 +293,12 @@ async function generateReport(console, httpUrl, matrixFile, filePath, tempDir, s console.info(`FileType: ${type.mime}`); return {clean: false, info: 'File type not supported'}; } - try { - fs.copyFileSync(filePath, decryptedFilePath); - } catch (err) { - console.error(err); - throw new ClientError(400, 'Failed to copy file for decryption', 'MCS_MEDIA_FAILED_TO_DECRYPT'); - } + } + try { + fs.copyFileSync(filePath, decryptedFilePath); + } catch (err) { + console.error(err); + throw new ClientError(400, 'Failed to copy file for decryption', 'MCS_MEDIA_FAILED_TO_DECRYPT'); } }