From 54793437a142e8f42d3a53e39cfc39b04e73ae35 Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Sun, 6 Jul 2025 19:52:48 +0200 Subject: [PATCH] Handle empty customers array in filtering logic --- internal_frontend/app/customers/page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal_frontend/app/customers/page.tsx b/internal_frontend/app/customers/page.tsx index 741b18d..614d439 100644 --- a/internal_frontend/app/customers/page.tsx +++ b/internal_frontend/app/customers/page.tsx @@ -50,6 +50,8 @@ export default function CustomersPage() { }, []); const filtered = useMemo(() => { + if(customers.length === 0) return []; + return customers.filter( (c) => c.name.toLowerCase().includes(search.toLowerCase()) ||