0

Guard against invalid chat messages with no user object

This commit is contained in:
Gabe Kangas 2022-01-12 20:23:01 -08:00
parent 01d83064da
commit 995080b478
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA

View File

@ -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);