Skip to content

Commit

Permalink
prevent undefined color array exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Jul 12, 2019
1 parent 434c9de commit 3fe4bd9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 3fe4bd9

Please sign in to comment.