From 06ece16d62dac44cb12f4d84b7e8f08d9350a500 Mon Sep 17 00:00:00 2001 From: Drew Harwell Date: Fri, 22 Nov 2019 10:46:46 -0500 Subject: [PATCH] guard against next page not being found in AP feed --- lib/convertv2.js | 1 + lib/template.ejs | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/convertv2.js b/lib/convertv2.js index d6d6490..35f0699 100644 --- a/lib/convertv2.js +++ b/lib/convertv2.js @@ -204,6 +204,7 @@ async function itemsForFeed(opts,user,feed) { function getNextPage(opts,user,feed){ //based on feed.next + if (!feed.next){return null} // take feed.next, uriencode it, then take user url, then take options.mastofeedUrl var base = opts.mastofeedUrl.slice(0,opts.mastofeedUrl.indexOf('?')); diff --git a/lib/template.ejs b/lib/template.ejs index 31f3b21..56884fe 100644 --- a/lib/template.ejs +++ b/lib/template.ejs @@ -92,15 +92,12 @@ <%= item.stringDate %> <% }); %> - <% if (nextPageLink) %> - - <% %> - + <% if (nextPageLink){ %> + + <% } %> <% if ( isIndex ){ %>