Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: avatar url startsWith error (#30053)

Alaister Youngb5a515aca613
diff --git a/apps/studio/components/interfaces/Auth/Users/Users.utils.tsx b/apps/studio/components/interfaces/Auth/Users/Users.utils.tsx
index 4bb4eaf5024..a1cf50f2c64 100644
--- a/apps/studio/components/interfaces/Auth/Users/Users.utils.tsx
+++ b/apps/studio/components/interfaces/Auth/Users/Users.utils.tsx
@@ -211,9 +211,9 @@ export function getAvatarUrl(user: User): string | undefined {
profileImageUrl ||
profileImageURL ||
profile_image_url ||
- '') as string | undefined
+ '') as unknown
- if (url === undefined) return undefined
+ if (typeof url !== 'string') return undefined
const isSupported = SUPPORTED_CSP_AVATAR_URLS.some((x) => url.startsWith(x))
return isSupported ? url : undefined
}