Skip to content

Commit de9ecc2

Browse files
committedAug 30, 2024·
fix: ensure loc is always a string
1 parent 2b16423 commit de9ecc2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/runtime/nitro/sitemap/urlset/normalise.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ export function preNormalizeEntry(_e: SitemapUrl | string): ResolvedSitemapUrl {
3333
e.loc = e.url
3434
delete e.url
3535
}
36+
if (typeof e.loc !== 'string') {
37+
e.loc = ''
38+
}
3639
// we want a uniform loc so we can dedupe using it, remove slashes and only get the path
37-
e.loc = removeTrailingSlash(e.loc || '')
40+
e.loc = removeTrailingSlash(e.loc)
3841
e._abs = hasProtocol(e.loc, { acceptRelative: false, strict: false })
3942
try {
4043
e._path = e._abs ? parseURL(e.loc) : parsePath(e.loc)

0 commit comments

Comments
 (0)
Please sign in to comment.