Skip to content

Commit

Permalink
fix dataset without default_style crashes the application (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Oct 18, 2021
1 parent a31bd46 commit e634e8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions geonode_mapstore_client/client/js/epics/gnresource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e634e8d

Please sign in to comment.