mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:51:44 +00:00
Fix global navbar crash (#13859)
* use nullish coalescing to prevent nullish query * actually use nullish coalescing to prevent nullish query
This commit is contained in:
parent
57b88bf529
commit
b51bed6bf8
@ -112,7 +112,8 @@ export const GlobalNavbar: React.FunctionComponent<Props> = ({
|
||||
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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user