Skip to content

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

Add guards

Joshen Limce88cbc8188c
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackDropdown.utils.ts b/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackDropdown.utils.ts
index 00d9c890d80..16a30ad725d 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackDropdown.utils.ts
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackDropdown.utils.ts
@@ -53,9 +53,12 @@ export const uploadAttachment = async (ref: string, image: string) => {
return undefined
}
- const { data } = await supportSupabaseClient.storage
- .from('feedback-attachments')
- .createSignedUrls([file.path], 10 * 365 * 24 * 60 * 60)
+ if (file) {
+ const { data } = await supportSupabaseClient.storage
+ .from('feedback-attachments')
+ .createSignedUrls([file.path], 10 * 365 * 24 * 60 * 60)
+ return data?.[0].signedUrl
+ }
- return data?.[0].signedUrl
+ return undefined
}