diff --git a/src/client/updateClientMetaInfo.js b/src/client/updateClientMetaInfo.js index e7bb46a..b0bf87c 100644 --- a/src/client/updateClientMetaInfo.js +++ b/src/client/updateClientMetaInfo.js @@ -1,5 +1,6 @@ import { metaInfoOptionKeys, metaInfoAttributeKeys } from '../shared/constants' import { updateAttribute, updateTag, updateTitle } from './updaters' +import isArray from '../shared/isArray' const getTag = (tags, tag) => { if (!tags[tag]) { @@ -46,6 +47,11 @@ export default function updateClientMetaInfo(options = {}, newInfo) { continue } + // tags should always be an array, ignore if it isnt + if (!isArray(newInfo[type])) { + continue + } + const { oldTags, newTags } = updateTag( options, type, diff --git a/src/client/updaters/tag.js b/src/client/updaters/tag.js index 7167d8b..5b28ff9 100644 --- a/src/client/updaters/tag.js +++ b/src/client/updaters/tag.js @@ -26,7 +26,7 @@ export default function updateTag({ attribute, tagIDKeyName } = {}, type, tags, }) } - if (tags && tags.length) { + if (tags.length) { tags.forEach((tag) => { const newElement = document.createElement(type) newElement.setAttribute(attribute, 'true')