aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/react/reducers')
-rw-r--r--src/client/react/reducers/search.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/react/reducers/search.ts b/src/client/react/reducers/search.ts
index 658d3ca..470e650 100644
--- a/src/client/react/reducers/search.ts
+++ b/src/client/react/reducers/search.ts
@@ -61,7 +61,7 @@ const search = (state = DEFAULT_STATE, action: Action): State => {
if (isExactMatch) return state;
const prevSelectedResult = state.selectedResult;
- const prevSelectedResultIndex = results.indexOf(prevSelectedResult);
+ const prevSelectedResultIndex = prevSelectedResult ? results.indexOf(prevSelectedResult) : -1;
let nextSelectedResultIndex =
prevSelectedResultIndex + action.relativeChange;