Add null check

pull/9786/head
Rob Jack Stewart 3 months ago
parent 37ab270c89
commit e974a09144

@ -161,12 +161,12 @@ class MovieSearchInput extends Component {
return;
}
// If a suggestion is highlighted, go to that movie
// otherwise search for a new movie
if (highlightedSuggestionIndex) {
this.goToMovie(suggestions[highlightedSuggestionIndex]);
} else {
// If no suggestion is highlighted, search for a new movie
// otherwise go to the suggested movie
if (highlightedSuggestionIndex == null) {
this.props.onGoToAddNewMovie(value);
} else {
this.goToMovie(suggestions[highlightedSuggestionIndex]);
}
this._autosuggest.input.blur();

Loading…
Cancel
Save