From 068069982255b34683ec14a165c800f6c36983d7 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 11 Mar 2022 02:52:13 -0800 Subject: [PATCH] Hotfix potentially null recents array --- components/SearchModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/SearchModal/index.tsx b/components/SearchModal/index.tsx index 61d63a82..1b520fef 100644 --- a/components/SearchModal/index.tsx +++ b/components/SearchModal/index.tsx @@ -126,7 +126,7 @@ const SearchModal = (props: Props) => { } } - if (recents.length > 5) recents.pop() + if (recents && recents.length > 5) recents.pop() setCookies(`recent_${props.object}`, recents, { path: '/' }) sendData(result) }