Chats: fix null attachment normalization

This commit is contained in:
Alex Gleason 2022-10-21 23:10:38 -05:00
parent e9578a7c9a
commit 427b8f9175
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 7 additions and 1 deletions

View File

@ -25,7 +25,13 @@ export const ChatMessageRecord = ImmutableRecord({
});
const normalizeMedia = (status: ImmutableMap<string, any>) => {
return status.update('attachment', null, normalizeAttachment);
const attachment = status.get('attachment');
if (attachment) {
return status.set('attachment', normalizeAttachment(attachment));
} else {
return status;
}
};
export const normalizeChatMessage = (chatMessage: Record<string, any>) => {