Skip to content

Commit

Permalink
Merge branch '325-sentry-cannot-read-properties-of-undefined-reading-…
Browse files Browse the repository at this point in the history
…searchterm' into 'master'

Sentry: Cannot read properties of undefined (reading 'searchTerm')

See merge request kchat/webapp!518
  • Loading branch information
antonbuks committed Oct 3, 2023
2 parents 8012fd6 + a00c8c9 commit 4c98e13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ const Search: React.FC<Props> = (props: Props): JSX.Element => {
} else if (indexChangedViaKeyPress) {
e.preventDefault();
setKeepInputFocused(true);
handleAddSearchTerm(visibleSearchHintOptions[highlightedSearchHintIndex].searchTerm);
if (visibleSearchHintOptions[highlightedSearchHintIndex]?.searchTerm) {
handleAddSearchTerm(visibleSearchHintOptions[highlightedSearchHintIndex].searchTerm);
}
}

if (props.isMentionSearch) {
Expand Down

0 comments on commit 4c98e13

Please sign in to comment.