From 8336a3d4244522b175cf2ed8173cf90201c251f9 Mon Sep 17 00:00:00 2001 From: teddit Date: Sun, 29 Nov 2020 21:55:36 +0100 Subject: [PATCH] fix an issue when sidebar data is missing --- views/subreddit.pug | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/views/subreddit.pug b/views/subreddit.pug index 4b160af..71c5bb6 100644 --- a/views/subreddit.pug +++ b/views/subreddit.pug @@ -117,13 +117,14 @@ html label(for="nsfw") include NSFW results input(type="checkbox", name="nsfw", id="nsfw", checked="checked") input(type="submit", value="search") - .content - p subscribers: #{sidebar_data.subscribers.toLocaleString()} - p users here right now: #{sidebar_data.active_user_count.toLocaleString()} - br - .heading - p.title #{sidebar_data.title} - .short-description - != unescape(sidebar_data.public_description_html) - .description - != unescape(sidebar_data.description_html) + if sidebar_data + .content + p subscribers: #{sidebar_data.subscribers.toLocaleString()} + p users here right now: #{sidebar_data.active_user_count.toLocaleString()} + br + .heading + p.title #{sidebar_data.title} + .short-description + != unescape(sidebar_data.public_description_html) + .description + != unescape(sidebar_data.description_html)