From 4f447305c9637d0be717072e2bd7f4901352bacb Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 6 Jun 2017 14:50:52 +0530 Subject: [PATCH] Fixing minor issue in viewing geo fence --- .../app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js index fef348afe9..91296f1793 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js @@ -310,7 +310,7 @@ function updateDrawing(updatedGeoJson) { function viewFence(geoFenceElement,id) { var geoJson = $(geoFenceElement).attr('data-geoJson'); var matchResults = /(?:"geoFenceGeoJSON"):"{(.*)}"/g.exec(geoJson); - if (matchResults.length > 1) { + if (matchResults && matchResults.length > 1) { geoJson = "{" + matchResults[1] + "}"; } geoJson = JSON.parse(geoJson.replace(/'/g, '"'));