Don’t barf when post-processing a non-existing post.
[Sone.git] / 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);