You've already forked AstralRinth
fix: guard against non-strings when decorating download urls (#6194)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
<div v-else class="input-group mt-2">
|
||||
<ButtonStyled v-if="primaryFile && !currentMember" color="brand">
|
||||
<ButtonStyled v-if="primaryFile?.url && !currentMember" color="brand">
|
||||
<a
|
||||
v-tooltip="primaryFile.filename + ' (' + formatBytes(primaryFile.size) + ')'"
|
||||
:href="decoratedPrimaryFileUrl"
|
||||
|
||||
Reference in New Issue
Block a user