Fixing minor issue in viewing geo fence

This commit is contained in:
Rasika Perera 2017-06-06 14:50:52 +05:30
parent 8548e911aa
commit 4f447305c9

View File

@ -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, '"'));