Guard against invalid chat messages with no user object
This commit is contained in:
parent
01d83064da
commit
995080b478
@ -45,6 +45,12 @@ export default class ChatMessageView extends Component {
|
||||
render() {
|
||||
const { message, isModerator, accessToken } = this.props;
|
||||
const { user, timestamp } = message;
|
||||
|
||||
// User is required for this component to render.
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { displayName, displayColor, createdAt } = user;
|
||||
const isAuthorModerator = checkIsModerator(message);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user