From a247c09623f3709d2f6ca4634db21a2d8a988ae4 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Mon, 10 Jul 2017 16:04:17 +0530 Subject: [PATCH] Fix for windows NaN value --- .../device-view.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js index f70036e408..42c90e23c3 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js @@ -91,7 +91,7 @@ function onRequest(context) { viewModel["ramUsage"]["value"] = (filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"]); viewModel["internalMemory"] = {}; - viewModel["internalMemory"]["value"] = Math.round((filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) / 1024); + viewModel["internalMemory"]["value"] = replaceNaNVal(Math.round((filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) / 1024)); } if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) { @@ -118,4 +118,11 @@ function onRequest(context) { deviceViewData["autoCompleteParams"] = autoCompleteParams; deviceViewData["permissions"] = permissions; return deviceViewData; + + function replaceNaNVal(val) { + if (isNaN(val)) { + return "N/A"; + } + return val; + } } \ No newline at end of file