From 17e0caed38d3040cc7626459f02f19814f03ec0c Mon Sep 17 00:00:00 2001 From: Suhas Vishwanath Date: Wed, 1 Nov 2023 18:51:43 +0530 Subject: [PATCH] avniproject/avni-client#1161 | Bump models version. Fix null pointer error in getAllSyncStatus --- packages/openchs-android/package.json | 2 +- .../openchs-android/src/service/EntitySyncStatusService.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/openchs-android/package.json b/packages/openchs-android/package.json index a5be6ae29..ffaf0fd23 100644 --- a/packages/openchs-android/package.json +++ b/packages/openchs-android/package.json @@ -57,7 +57,7 @@ "lodash": "4.17.21", "moment": "2.29.4", "native-base": "3.4.9", - "openchs-models": "1.30.83", + "openchs-models": "1.30.85", "prop-types": "15.8.1", "react": "18.2.0", "react-native": "0.72.3", diff --git a/packages/openchs-android/src/service/EntitySyncStatusService.js b/packages/openchs-android/src/service/EntitySyncStatusService.js index ebc27ca1c..5ffa5e9c0 100644 --- a/packages/openchs-android/src/service/EntitySyncStatusService.js +++ b/packages/openchs-android/src/service/EntitySyncStatusService.js @@ -59,11 +59,12 @@ class EntitySyncStatusService extends BaseService { const entities = _.map(this.findAllByUniqueEntityName(), ({entityName, loadedSince}) => { const isNeverSynced = loadedSince.getTime() === EntitySyncStatus.REALLY_OLD_DATE.getTime(); const queuedItemCount = entityQueueService.getQueuedItemCount(entityName); + const emd = EntityMetaData.findByName(entityName); return { entityName: entityName, loadedSince: isNeverSynced ? 'Never or Not Applicable' : moment(loadedSince).format("DD-MM-YYYY HH:MM:SS"), queuedCount: queuedItemCount, - type: EntityMetaData.findByName(entityName).type + type: emd && emd.type } }); const mediaQueueService = this.getService(MediaQueueService);