fix: guard against non-strings when decorating download urls (#6194)

This commit is contained in:
Prospector
2026-05-24 10:42:27 -07:00
committed by GitHub
parent 3889d0f5ec
commit bcce7e28fd
2 changed files with 6 additions and 2 deletions
@@ -63,7 +63,11 @@ export function useCdnDownloadContext() {
})
function createProjectDownloadUrl(originalUrl: string, context?: DownloadContext): string {
if (!originalUrl.startsWith('https://cdn.modrinth.com')) {
if (
typeof originalUrl !== 'string' ||
!originalUrl ||
!originalUrl.startsWith('https://cdn.modrinth.com')
) {
return originalUrl
}