From 7fc6ad32d07ff7f73fb11656c2799d6a20259f8c Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Fri, 2 Apr 2021 16:03:32 +1100 Subject: [PATCH] webring schedule improvement --- schedules/tasks/webring.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/schedules/tasks/webring.js b/schedules/tasks/webring.js index dd9e38da..3ccd303c 100644 --- a/schedules/tasks/webring.js +++ b/schedules/tasks/webring.js @@ -67,7 +67,9 @@ module.exports = { name: board.title, description: board.subtitle, }; - board.lastPostTimestamp = new Date(board.lastPostTimestamp.toString()); + if (board.lastPostTimestamp) { + board.lastPostTimestamp = new Date(board.lastPostTimestamp.toString()); + } }); webringBoards = webringBoards.concat(ring.boards); } @@ -78,6 +80,7 @@ module.exports = { if (webringBoards.length > 0) { webringBoards = webringBoards.map(x => { x.webring = true; + delete x._id; //would cause inserterror, but still dont wanna let that happen return x; }); await Boards.db.insertMany(webringBoards);