From 0f83cf5faf9bc9f6b496b417731300a80520f22f Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 23 Dec 2025 16:24:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(hooks):=20=E4=BF=AE=E5=A4=8D=20useTable=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AD=97=E6=AE=B5=E5=88=97=E8=A1=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/table.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/common/table.ts b/src/hooks/common/table.ts index 1fc66079..096fcf50 100644 --- a/src/hooks/common/table.ts +++ b/src/hooks/common/table.ts @@ -463,7 +463,11 @@ function getColumns>(cols: Column[], che } }); - const filteredColumns = checks.filter(item => item.checked).map(check => columnMap.get(check.key) as Column); + // Filter out any checks that do not have a corresponding column (can happen when column definitions change). + const filteredColumns = checks + .filter(item => item.checked) + .map(check => columnMap.get(check.key)) + .filter((col): col is Column => Boolean(col)); return filteredColumns; }