Skip to content

Commit

Permalink
Fix lookup and color field formatters (elastic#84994)
Browse files Browse the repository at this point in the history
* fix lookup field formatter

* fix color formatter
  • Loading branch information
mattkime committed Dec 4, 2020
1 parent a28703b commit 8e6ead2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ColorFormatEditor extends DefaultFormatEditor<ColorFormatEditorForm
};

addColor = () => {
const colors = [...this.props.formatParams.colors];
const colors = [...(this.props.formatParams.colors || [])];
this.onChange({
colors: [...colors, { ...fieldFormats.DEFAULT_CONVERTER_COLOR }],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class StaticLookupFormatEditor extends DefaultFormatEditor<StaticLookupFo
};

addLookup = () => {
const lookupEntries = [...this.props.formatParams.lookupEntries];
const lookupEntries = [...(this.props.formatParams.lookupEntries || [])];
this.onChange({
lookupEntries: [...lookupEntries, {}],
});
Expand Down

0 comments on commit 8e6ead2

Please sign in to comment.