From b51bed6bf8b69972aeeddce00c7b07e17759bc26 Mon Sep 17 00:00:00 2001 From: TJ Kandala Date: Wed, 16 Sep 2020 12:38:21 -0400 Subject: [PATCH] Fix global navbar crash (#13859) * use nullish coalescing to prevent nullish query * actually use nullish coalescing to prevent nullish query --- web/src/nav/GlobalNavbar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/nav/GlobalNavbar.tsx b/web/src/nav/GlobalNavbar.tsx index e260e6b7230..7f5da17ab1a 100644 --- a/web/src/nav/GlobalNavbar.tsx +++ b/web/src/nav/GlobalNavbar.tsx @@ -112,7 +112,8 @@ export const GlobalNavbar: React.FunctionComponent = ({ onNavbarQueryChange({ query, cursorPosition: query.length }) } else { // If we have no component state, then we may have gotten unmounted during a route change. - const query = location.state ? location.state.query : '' + const query = location.state?.query ?? '' + onNavbarQueryChange({ query, cursorPosition: query.length,