From a6883c55bb1b31f5f338c1bcd08eddf5fdaba5ce Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe Date: Thu, 13 Feb 2020 19:23:14 +0530 Subject: [PATCH] Fix APPM store app crash on app installation product-iots#325 --- .../src/components/apps/release/install/DeviceInstall.js | 8 +++++--- .../components/apps/release/install/DeviceUninstall.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js index dcb4b2b30c..94dd414243 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js @@ -85,9 +85,11 @@ const columns = [ key: 'imei', render: properties => { let imei = 'not-found'; - for (let i = 0; i < properties.length; i++) { - if (properties[i].name === 'IMEI') { - imei = properties[i].value; + if (properties) { + for (let i = 0; i < properties.length; i++) { + if (properties[i].name === 'IMEI') { + imei = properties[i].value; + } } } return imei; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js index f48fad0d80..303c1ecae0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js @@ -85,9 +85,11 @@ const columns = [ key: 'imei', render: properties => { let imei = 'not-found'; - for (let i = 0; i < properties.length; i++) { - if (properties[i].name === 'IMEI') { - imei = properties[i].value; + if (properties) { + for (let i = 0; i < properties.length; i++) { + if (properties[i].name === 'IMEI') { + imei = properties[i].value; + } } } return imei;