File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { SLINGSHOT_HOST } from '#shared/utils/constants'
66import { useServerSession } from '#server/utils/server-session'
77import { handleApiError } from '#server/utils/error-handler'
88import type { DidString } from '@atproto/lex'
9- import { Client , isAtUriString } from '@atproto/lex'
9+ import { Client , isAtUriString , isTypedBlobRef } from '@atproto/lex'
1010import * as app from '#shared/types/lexicons/app'
1111import * as blue from '#shared/types/lexicons/blue'
1212import { isAtIdentifierString } from '@atproto/lex'
@@ -271,11 +271,11 @@ async function getAvatar(did: DidString, pds: string) {
271271 } )
272272
273273 const validatedResponse = app . bsky . actor . profile . main . validate ( profileResponse . value )
274- const cid = validatedResponse . avatar ?. ref
274+ const cid = validatedResponse . avatar
275275
276- if ( cid ) {
276+ if ( cid && isTypedBlobRef ( cid ) && cid . ref ) {
277277 // Use Bluesky CDN for faster image loading
278- avatar = `https://cdn.bsky.app/img/feed_thumbnail/plain/${ did } /${ cid } @jpeg`
278+ avatar = `https://cdn.bsky.app/img/feed_thumbnail/plain/${ did } /${ cid . ref } @jpeg`
279279 }
280280 }
281281 } catch {
You can’t perform that action at this time.
0 commit comments