Skip to content

Commit 12c7949

Browse files
pimlieTheAlexLichter
authored andcommitted
fix: dont updateTags when the new info is not an array
1 parent 4fc67df commit 12c7949

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/client/updateClientMetaInfo.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { metaInfoOptionKeys, metaInfoAttributeKeys } from '../shared/constants'
22
import { updateAttribute, updateTag, updateTitle } from './updaters'
3+
import isArray from '../shared/isArray'
34

45
const getTag = (tags, tag) => {
56
if (!tags[tag]) {
@@ -46,6 +47,11 @@ export default function updateClientMetaInfo(options = {}, newInfo) {
4647
continue
4748
}
4849

50+
// tags should always be an array, ignore if it isnt
51+
if (!isArray(newInfo[type])) {
52+
continue
53+
}
54+
4955
const { oldTags, newTags } = updateTag(
5056
options,
5157
type,

src/client/updaters/tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function updateTag({ attribute, tagIDKeyName } = {}, type, tags,
2626
})
2727
}
2828

29-
if (tags && tags.length) {
29+
if (tags.length) {
3030
tags.forEach((tag) => {
3131
const newElement = document.createElement(type)
3232
newElement.setAttribute(attribute, 'true')

0 commit comments

Comments
 (0)