Return early if the Sone can not be found.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ViewSonePage.java
index d04fe27..889c74c 100644 (file)
@@ -81,6 +81,9 @@ public class ViewSonePage extends SoneTemplatePage {
                Sone sone = webInterface.getCore().getSone(soneId, false);
                templateContext.set("sone", sone);
                templateContext.set("soneId", soneId);
+               if (sone == null) {
+                       return;
+               }
                List<Post> sonePosts = sone.getPosts();
                sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone));
                Collections.sort(sonePosts, Post.TIME_COMPARATOR);