From a19e7d05141838d8d54852d31896b3f2bbfd9770 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sat, 5 Mar 2022 16:24:42 +0200 Subject: [PATCH] Prevented errors from crashing archive restoration --- app/imports/migrations/server/migrateArchive.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/imports/migrations/server/migrateArchive.js b/app/imports/migrations/server/migrateArchive.js index 42f04c26..52403790 100644 --- a/app/imports/migrations/server/migrateArchive.js +++ b/app/imports/migrations/server/migrateArchive.js @@ -22,7 +22,12 @@ function cleanAt1(archive){ archive.properties.map(prop => { const schema = CreatureProperties.simpleSchema(prop); const cleanProp = schema.clean(prop); - schema.validate(cleanProp); + try { + schema.validate(cleanProp); + } catch (e){ + console.warn('Prop did not pass schema validation'); + console.warn(e); + } return cleanProp; }); }