From e634e8dc3bba1a10db3367712ce45eec9e2df561 Mon Sep 17 00:00:00 2001 From: stefano bovio Date: Mon, 18 Oct 2021 11:59:12 +0200 Subject: [PATCH] fix dataset without default_style crashes the application (#540) --- geonode_mapstore_client/client/js/epics/gnresource.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/geonode_mapstore_client/client/js/epics/gnresource.js b/geonode_mapstore_client/client/js/epics/gnresource.js index 1cbac6928e..0f75d22d12 100644 --- a/geonode_mapstore_client/client/js/epics/gnresource.js +++ b/geonode_mapstore_client/client/js/epics/gnresource.js @@ -79,6 +79,11 @@ const resourceTypes = { .then((response) => { const [mapConfig, gnLayer] = response; const newLayer = resourceToLayerConfig(gnLayer); + + if (!newLayer.defaultStyle || page !== 'dataset_edit_style_viewer') { + return [mapConfig, gnLayer, newLayer]; + } + return StylesAPI.getStylesInfo({ baseUrl: options?.styleService?.baseUrl, styles: [newLayer.defaultStyle]