diff --git a/core/msg_list.js b/core/msg_list.js index e94f1bae..19d8f78c 100644 --- a/core/msg_list.js +++ b/core/msg_list.js @@ -315,9 +315,16 @@ exports.getModule = class MessageListModule extends ( let msgNum = 1; self.config.messageList.forEach((listItem, index) => { listItem.msgNum = msgNum++; - listItem.ts = moment(listItem.modTimestamp).format( - dateTimeFormat - ); + try { + listItem.ts = moment(listItem.modTimestamp).format( + dateTimeFormat + ); + } catch (e) { + self.client.log.warn( + `Error parsing "${listItem.modTimestamp}"; expected timestamp: ${e.message}` + ); + listItem.ts = moment().format(dateTimeFormat); + } const isNew = _.isBoolean(listItem.isNew) ? listItem.isNew : listItem.messageId > self.lastReadId;