From fe5eab5763ea0830914ffc4dbe4a4fbd57b93bd6 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 9 Feb 2021 16:05:21 -0800 Subject: [PATCH] Fix stray null error in SearchToolbar Oops, we don't provide this in the item search page, so check for that! --- src/app/WardrobePage/SearchToolbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/WardrobePage/SearchToolbar.js b/src/app/WardrobePage/SearchToolbar.js index 468cad4..e4f2d55 100644 --- a/src/app/WardrobePage/SearchToolbar.js +++ b/src/app/WardrobePage/SearchToolbar.js @@ -47,7 +47,7 @@ export function searchQueryIsEmpty(query) { function SearchToolbar({ query, searchQueryRef, - firstSearchResultRef, + firstSearchResultRef = null, onChange, autoFocus, showItemsLabel = false, @@ -77,7 +77,7 @@ function SearchToolbar({ zoneLabels.sort(); const onMoveFocusDownToResults = (e) => { - if (firstSearchResultRef.current) { + if (firstSearchResultRef && firstSearchResultRef.current) { firstSearchResultRef.current.focus(); e.preventDefault(); }