Don’t barf when post-processing a non-existing post.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 20 Jan 2011 07:45:33 +0000 (08:45 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 20 Jan 2011 07:45:33 +0000 (08:45 +0100)
src/main/java/net/pterodactylus/sone/web/ViewPostPage.java

index cdbc6da..864dc84 100644 (file)
@@ -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);