From 1b9ebd3fbf94e43c4031eb0455bc947bff515b10 Mon Sep 17 00:00:00 2001 From: okxint Date: Mon, 27 Jul 2026 12:11:01 +0530 Subject: [PATCH] fix: guard against undefined table in updateKeyName tableList.tables.find() returns undefined when the selected table is not yet in the loaded page or the list hasn't finished loading. Dereferencing table.name without a null check caused a TypeError crash when creating a relationship attribute. Add an explicit guard so data.key is only updated when the table is found. --- .../table-[table]/columns/relationship.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/columns/relationship.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/columns/relationship.svelte index df2a540af1..b857c2c4e0 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/columns/relationship.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/columns/relationship.svelte @@ -110,7 +110,9 @@ function updateKeyName() { if (!editing) { const table = tableList.tables.find((n) => n.$id === data.relatedTable); - data.key = camelize(table.name); + if (table) { + data.key = camelize(table.name); + } } }