diff --git a/website/server/models/group.js b/website/server/models/group.js index 65b49aee45..5ab0b154c9 100644 --- a/website/server/models/group.js +++ b/website/server/models/group.js @@ -348,7 +348,7 @@ schema.statics.toJSONCleanChat = async function groupToJSONCleanChat (group, use toJSON.chat.forEach(chat => { // old chats are saved with a numeric timestamp // new chats use `Date` which then has to be converted to the numeric timestamp - if (chat.timestamp.getTime) { + if (chat.timestamp && chat.timestamp.getTime) { chat.timestamp = chat.timestamp.getTime(); } });