From ebb53db4ad85c23c935b3cb9bc2987a7337dbd86 Mon Sep 17 00:00:00 2001 From: Kaspar Date: Wed, 13 Jun 2018 20:13:18 +0200 Subject: [PATCH] fix: first time uploadMessage called with undefined as parameter (#204) * fix: first time uploadMessage called with undefined as parameter - During uploading DICOMs the first time the function is called with no parameter -> this leads to the whole upload to be crashing * Write the function shorter... --- Packages/ohif-study-list/client/lib/importStudies.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/ohif-study-list/client/lib/importStudies.js b/Packages/ohif-study-list/client/lib/importStudies.js index 4a6b73f17..bf807c666 100644 --- a/Packages/ohif-study-list/client/lib/importStudies.js +++ b/Packages/ohif-study-list/client/lib/importStudies.js @@ -11,7 +11,7 @@ OHIF.studylist.importStudies = filesToImport => { return new Promise((resolve, reject) => reject('No files to upload')); } - const uploadMessage = ({ processed, total }) => `Uploaded files: ${processed} / ${total}`; + const uploadMessage = msg => (typeof msg === 'undefined') ? '' : `Uploaded files: ${msg.processed} / ${msg.total}`; const taskRunHandler = dialog => { const uploadErrorHandler = fileNames => {