X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Ftemplate-helper.js;h=c633e41542505c17c091d8e2e6866276e1bf8372;hb=afc5da271215282fa723e79a12562d3b86734326;hp=b48a90ae6d02046dd7244788ec11d150e0c40ad8;hpb=38aba0869dc3ade99d439e74cbc6239b4fa1f632;p=websub-hub diff --git a/src/template/template-helper.js b/src/template/template-helper.js index b48a90a..c633e41 100644 --- a/src/template/template-helper.js +++ b/src/template/template-helper.js @@ -61,6 +61,11 @@ const secondsToPeriod = (seconds) => { * @returns {String} */ function renderTopicRow(topic, subscribers, detailsLink = true) { + if (!topic) { + return ` + (topic not found) +`; + } return ` ${detailsLink ? '' : ''}${topic.url}${detailsLink ? '' : ''} ${subscribers.length} @@ -112,6 +117,11 @@ function renderTopicRowHeader() { * @returns {String} */ function renderSubscriptionRow(subscription) { + if (!subscription) { + return ` + (topic not found) +`; + } return ` ${subscription.callback} ${dateOrNot(subscription.created, 'Unknown')} @@ -221,41 +231,50 @@ function htmlHeader(pageTitle, navLinks = []) { /** * Close the main section and finish off with boilerplate. + * @param {String[]} footerEntries * @returns {String} */ -function htmlFooter() { +function htmlFooter(footerEntries = []) { return ` -