From 1a2260515d38dfa577b41cc0fb34f9a528689b43 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sun, 14 Feb 2021 19:17:14 +1100 Subject: [PATCH] Added error for invalid file --- src/workers/DatabaseWorker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/workers/DatabaseWorker.js b/src/workers/DatabaseWorker.js index 08e5dff..dba2aca 100644 --- a/src/workers/DatabaseWorker.js +++ b/src/workers/DatabaseWorker.js @@ -86,6 +86,10 @@ let service = { */ async importData(data, databaseName, progressCallback) { const importMeta = await peakImportFile(data); + if (!importMeta.data) { + throw new Error("Uanble to parse file"); + } + let db = getDatabase({}); if (importMeta.data.databaseName !== db.name) {