Skip to content

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

chore: update null check

Qiao Han35ee01040792
diff --git a/studio/components/interfaces/Database/Tables/ColumnList.tsx b/studio/components/interfaces/Database/Tables/ColumnList.tsx
index 7be131dee70..c5b668777fc 100644
--- a/studio/components/interfaces/Database/Tables/ColumnList.tsx
+++ b/studio/components/interfaces/Database/Tables/ColumnList.tsx
@@ -27,9 +27,9 @@ const ColumnList: FC<Props> = ({
const columns =
(filterString.length === 0
? selectedTable.columns
- : selectedTable.columns!.filter((column: any) => column.name.includes(filterString))) ?? []
+ : selectedTable.columns?.filter((column: any) => column.name.includes(filterString))) ?? []
- const isLocked = meta.excludedSchemas.includes(selectedTable?.schema ?? '')
+ const isLocked = meta.excludedSchemas.includes(selectedTable.schema ?? '')
return (
<>
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
index 7acd632eaf6..e8146e33c43 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
@@ -71,7 +71,7 @@ const ForeignKeySelector: FC<Props> = ({
setSelectedForeignKey({
schema: table.schema,
table: table.name,
- column: table.columns!.length > 0 ? table.columns![0].name : undefined,
+ column: table.columns?.length ? table.columns[0].name : undefined,
})
}
}
diff --git a/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx b/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
index 26e1b54f45c..e62bfe19e34 100644
--- a/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
+++ b/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
@@ -92,7 +92,7 @@ const TableGridEditor: FC<Props> = ({
? parseSupaTable(
{
table: selectedTable as PostgresTable,
- columns: (selectedTable as PostgresTable).columns!,
+ columns: (selectedTable as PostgresTable).columns ?? [],
primaryKeys: (selectedTable as PostgresTable).primary_keys,
relationships: (selectedTable as PostgresTable).relationships,
},