From: David ‘Bombe’ Roden Date: Thu, 20 Jan 2011 07:45:33 +0000 (+0100) Subject: Don’t barf when post-processing a non-existing post. X-Git-Tag: 0.4.2^2~18 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c8f32a3dce696bfdb8b8b2b31cb736dae2524f71;p=Sone.git Don’t barf when post-processing a non-existing post. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java index cdbc6da..864dc84 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java @@ -62,6 +62,9 @@ public class ViewPostPage extends SoneTemplatePage { @Override protected void postProcess(Request request, TemplateContext templateContext) { Post post = (Post) templateContext.get("post"); + if (post == null) { + return; + } webInterface.getCore().markPostKnown(post); for (Reply reply : webInterface.getCore().getReplies(post)) { webInterface.getCore().markReplyKnown(reply);