Skip to content

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

Address Sentry issue (#38364)

Joshen Lim73e6bdf1b68f
diff --git a/apps/studio/components/layouts/Tabs/Tabs.utils.ts b/apps/studio/components/layouts/Tabs/Tabs.utils.ts
index f67aea00456..852baa2187d 100644
--- a/apps/studio/components/layouts/Tabs/Tabs.utils.ts
+++ b/apps/studio/components/layouts/Tabs/Tabs.utils.ts
@@ -50,7 +50,7 @@ export function useTableEditorTabsCleanUp() {
// e.g Using the SQL editor to rename the entity
const openTabs = openTabsRef.current
.map((id) => tabMapRef.current[id])
- .filter((tab) => editorEntityTypes['table']?.includes(tab.type))
+ .filter((tab) => !!tab && editorEntityTypes['table']?.includes(tab.type))
openTabs.forEach((tab) => {
const entity = entities?.find((x) => tab.metadata?.tableId === x.id)
@@ -97,7 +97,7 @@ export function useSqlEditorTabsCleanup() {
// e.g for a shared snippet, the owner could've updated the name of the snippet
const openSqlTabs = openTabsRef.current
.map((id) => tabMapRef.current[id])
- .filter((tab) => editorEntityTypes['sql']?.includes(tab.type))
+ .filter((tab) => !!tab && editorEntityTypes['sql']?.includes(tab.type))
openSqlTabs.forEach((tab) => {
const snippet = snippets?.find((x) => tab.metadata?.sqlId === x.id)
diff --git a/apps/studio/instrumentation-client.ts b/apps/studio/instrumentation-client.ts
index e1543a0e150..bafe2feee59 100644
--- a/apps/studio/instrumentation-client.ts
+++ b/apps/studio/instrumentation-client.ts
@@ -64,7 +64,7 @@ Sentry.init({
`Failed to construct 'URL': Invalid URL`
)
// [Joshen] Similar behaviour for this error from SessionTimeoutModal to control the quota usage
- const isSessionTimeoutEvent = (hint.originalException as any)?.message.includes(
+ const isSessionTimeoutEvent = (hint.originalException as any)?.message?.includes(
'Session error detected'
)