From 32bba0fc5311148424c5309d8def4489e3ac0b98 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 8 Jan 2020 09:26:35 -0300 Subject: [PATCH] [FIX] Error when normalizing empty messages (#1532) --- app/lib/methods/helpers/normalizeMessage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/lib/methods/helpers/normalizeMessage.js b/app/lib/methods/helpers/normalizeMessage.js index 2c6f11f97..adca75cd3 100644 --- a/app/lib/methods/helpers/normalizeMessage.js +++ b/app/lib/methods/helpers/normalizeMessage.js @@ -18,6 +18,9 @@ function normalizeAttachments(msg) { } export default (msg) => { + if (!msg) { + return null; + } msg = normalizeAttachments(msg); msg.reactions = msg.reactions || []; msg.unread = msg.unread || false;