Merged in fix/sitemap-fixes (pull request #2280)

fix:sitemap - added null check and correct content-type

* fix:sitemap - added null check and correct content-type

* Revert test code


Approved-by: Erik Tiekstra
This commit is contained in:
Linus Flood
2025-06-03 14:48:24 +00:00
parent dd4ef527df
commit 68763ee1fd
3 changed files with 18 additions and 6 deletions
+16 -4
View File
@@ -20,10 +20,22 @@ export function mergeEntries(
const entries = [...currentEntries]
newEntries.forEach((entry) => {
const index = entries.findIndex(
({ data }) =>
data.uid === entry.data.uid && data.locale === entry.data.locale
)
if (!entry?.data?.uid || !entry?.data?.locale) {
metricsEntriesMerge.dataError(
`Invalid entry data, missing uid or locale`,
{ entry }
)
return
}
const index = entries.findIndex(({ data }) => {
if (!data) {
metricsEntriesMerge.dataError(`Data is null or undefined,`)
return false
}
return data.uid === entry.data.uid && data.locale === entry.data.locale
})
if (index > -1) {
entries[index] = entry
} else {