mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
fix(tests): do not error when test chat messages miss the timestamp attribute
This commit is contained in:
parent
2132a3a242
commit
ac973ee753
1 changed files with 1 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue