From 3fe4bd9dd78ac416622da0a815467029b7f01a14 Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Fri, 12 Jul 2019 12:24:12 +0200 Subject: [PATCH] prevent undefined color array exceptions --- .../components/TOC/fragments/settings/ThematicLayer.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/client/components/TOC/fragments/settings/ThematicLayer.jsx b/web/client/components/TOC/fragments/settings/ThematicLayer.jsx index b9bf572174..a1fa28dc7c 100644 --- a/web/client/components/TOC/fragments/settings/ThematicLayer.jsx +++ b/web/client/components/TOC/fragments/settings/ThematicLayer.jsx @@ -217,11 +217,14 @@ class ThematicLayer extends React.Component { }; getColors = () => { - return this.props.getColors(this.props.colors, this.props.layer, this.props.colorSamples).map(({name, ...c}) => ({ + const colors = this.props.getColors(this.props.colors, this.props.layer, this.props.colorSamples); + if (colors) { + return colors.map(({name, ...c}) => ({ label: `global.colors.${name}`, name, ...c })); + } }; renderError = (error, type) => {