fail quietly when search messagelookup gets dropped

This commit is contained in:
Jamie Kyle 2023-06-21 15:02:07 -07:00 committed by GitHub
parent 7c5e6166ab
commit aacf37b6d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import { MessageSearchResult } from '../../components/conversationList/MessageSe
import { getPreferredBadgeSelector } from '../selectors/badges';
import { getIntl, getTheme } from '../selectors/user';
import { getMessageSearchResultSelector } from '../selectors/search';
import * as log from '../../logging/log';
type SmartProps = {
id: string;
@ -22,7 +23,8 @@ function mapStateToProps(state: StateType, ourProps: SmartProps) {
const props = getMessageSearchResultSelector(state)(id);
if (!props) {
throw new Error('SmartMessageSearchResult: no message was found');
log.error('SmartMessageSearchResult: no message was found');
return null;
}
return {