From c092cd5024afbf0c0a1bb2d419b81b15b8a288c0 Mon Sep 17 00:00:00 2001 From: HHao Date: Thu, 12 Dec 2024 21:33:47 +0800 Subject: [PATCH] fix(table): handle null values in isFilterValueExist (#4829) --- src/table/hooks/useFilter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/table/hooks/useFilter.tsx b/src/table/hooks/useFilter.tsx index 27b38529c2..2a3ad2b389 100644 --- a/src/table/hooks/useFilter.tsx +++ b/src/table/hooks/useFilter.tsx @@ -13,7 +13,7 @@ import { renderTitle } from './useTableHeader'; function isFilterValueExist(value: any) { const isArrayTrue = value instanceof Array && value.length; const isObject = typeof value === 'object' && !(value instanceof Array); - const isObjectTrue = isObject && Object.keys(value).length; + const isObjectTrue = value !== null && isObject && Object.keys(value).length; return isArrayTrue || isObjectTrue || !['null', '', 'undefined'].includes(String(value)); }