From d0aa7f900da99a00147429298f65011a263f7cd2 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Tue, 5 Sep 2023 13:24:23 +0200
Subject: [PATCH] Handle GeoJson with no features
---
ipmd/static/ipmd/js/ipmdlib.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipmd/static/ipmd/js/ipmdlib.js b/ipmd/static/ipmd/js/ipmdlib.js
index eb04428b..791bc4fe 100644
--- a/ipmd/static/ipmd/js/ipmdlib.js
+++ b/ipmd/static/ipmd/js/ipmdlib.js
@@ -395,7 +395,7 @@ async function initDataSourceMap(containerId, geoJson, countryCodeList, featureC
}
// If no data, no map
- if((geoJson == undefined || geoJson == null || geoJson.features.length == 0) && (countryCodeList == null || countryCodeList.length == 0))
+ if((geoJson == undefined || geoJson == null || geoJson.features == undefined || geoJson.features.length == 0) && (countryCodeList == null || countryCodeList.length == 0))
{
document.getElementById(containerId).innerHTML = "NO GEODATA PROVIDED BY WEATHER DATA SOURCE";
return;
--
GitLab