There was no null check for config.customAttributes

This commit is contained in:
Vesa Luusua 2018-01-04 14:19:30 +02:00
parent 8f401bc31a
commit 6f74c88cc0

View file

@ -232,8 +232,10 @@ export class ListingPageComponent extends Component {
} = currentListing.attributes;
const { customAttributes } = currentListing.attributes;
const hasCategoryConfig = config.customAttributes && config.customAttributes.category;
const hasCategoryAttribute = customAttributes && customAttributes.category;
const category =
config.customAttributes.category && customAttributes && customAttributes.category ? (
hasCategoryConfig && hasCategoryAttribute ? (
<span>
<FormattedMessage id={`ListingPage.category.${customAttributes.category}`} />
<span className={css.separator}></span>