Added error for invalid file

This commit is contained in:
Mitchell McCaffrey 2021-02-14 19:17:14 +11:00
parent f92be8c42f
commit 1a2260515d

View File

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