From c8f32a3dce696bfdb8b8b2b31cb736dae2524f71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 20 Jan 2011 08:45:33 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20barf=20when=20post-processing=20?= =?utf8?q?a=20non-existing=20post.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/ViewPostPage.java | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.7.4