From dd647837c5392b481874020948a2daa0b184baef Mon Sep 17 00:00:00 2001 From: himeshr Date: Tue, 7 Nov 2023 11:35:38 +0530 Subject: [PATCH] avniproject/avni-client#1161 | Avoid failing sync with "uuid call on undefined" error after running migration 180 --- src/Schema.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Schema.js b/src/Schema.js index 702966e..ac267c6 100644 --- a/src/Schema.js +++ b/src/Schema.js @@ -800,7 +800,7 @@ function createRealmConfig() { if (oldDB.schemaVersion < 180) { General.logInfo("Migration180", "Execution started") const individualsOfInterest = newDB.objects(Individual.schema.name).filtered("lowestAddressLevel = null"); - _.forEach(individualsOfInterest, (individual) => { + individualsOfInterest && individualsOfInterest.forEach((individual) => { General.logInfo("Migration180", "Deleting individual " + individual.uuid + " and related entities") MigrationsHelper.deleteIndividual(individual, newDB); })