Return early if the Sone can not be found.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 4 May 2011 04:18:32 +0000 (06:18 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 4 May 2011 04:18:32 +0000 (06:18 +0200)
NPE reported by saces and TheSeeker.

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);