From d2d13d92cd6f23fdd2655a411984757bff889b20 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Tue, 5 Mar 2024 18:03:23 +0100 Subject: [PATCH] Fix access to possibly null theme.predefinedFilters --- utils/ThemeUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ThemeUtils.js b/utils/ThemeUtils.js index d351ca209..b411ad7e2 100644 --- a/utils/ThemeUtils.js +++ b/utils/ThemeUtils.js @@ -133,7 +133,7 @@ const ThemeUtils = { featureInfoUrl: ThemeUtils.inheritBaseUrlParams(theme.featureInfoUrl, theme.url, baseParams), infoFormats: theme.infoFormats, layerTreeHiddenSublayers: theme.layerTreeHiddenSublayers, - predefinedFilters: theme.predefinedFilters.filter(entry => Object.keys(entry.filter).find(name => sublayerNames.includes(name))), + predefinedFilters: (theme.predefinedFilters || []).filter(entry => Object.keys(entry.filter).find(name => sublayerNames.includes(name))), externalLayerMap: { ...theme.externalLayerMap, ...(theme.externalLayers || []).reduce((res, cur) => {