Don't pass empty format configs to the fieldFormats helper (#27168)

This commit is contained in:
Joel Griffith 2018-12-14 13:01:48 -08:00 committed by GitHub
parent ce7265c554
commit 9f17c4ae39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,10 @@ export function fieldFormatMapFactory(indexPatternSavedObject, fieldFormats) {
const fieldFormatMap = JSON.parse(indexPatternSavedObject.attributes.fieldFormatMap);
Object.keys(fieldFormatMap).forEach((fieldName) => {
const formatConfig = fieldFormatMap[fieldName];
formatsMap.set(fieldName, fieldFormats.getInstance(formatConfig));
if (!_.isEmpty(formatConfig)) {
formatsMap.set(fieldName, fieldFormats.getInstance(formatConfig));
}
});
}