From 0c70c87406b8b37542f6bdab3a566250371e35e0 Mon Sep 17 00:00:00 2001 From: kamidu Date: Wed, 26 Oct 2016 17:39:47 +0530 Subject: [PATCH] fix for EMM-1673 --- .../app/modules/business-controllers/device.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index 26233a32d81..25cccf8c57f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -118,13 +118,18 @@ deviceModule = function () { if (properties["DEVICE_INFO"]) { var initialDeviceInfoList = parse(properties["DEVICE_INFO"]); var initialDeviceInfo = {}; - for (var j = 0; j < initialDeviceInfoList.length; j++) { - if (initialDeviceInfoList[j]["value"]) { - initialDeviceInfo[initialDeviceInfoList[j]["name"]] = - initialDeviceInfoList[j]["value"]; + if (Array.isArray(initialDeviceInfoList) { + for (var j = 0; j < initialDeviceInfoList.length; j++) { + if (initialDeviceInfoList[j]["value"]) { + initialDeviceInfo[initialDeviceInfoList[j]["name"]] = + initialDeviceInfoList[j]["value"]; + } } + } else { + initialDeviceInfo = initialDeviceInfoList; } + filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"] = initialDeviceInfo; } }