From: David ‘Bombe’ Roden Date: Wed, 4 May 2011 04:18:32 +0000 (+0200) Subject: Return early if the Sone can not be found. X-Git-Tag: 0.6.4^2~28 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=544587bac1ceb84f8d56452cd2a891be74439fa3 Return early if the Sone can not be found. NPE reported by saces and TheSeeker. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java index d04fe27..889c74c 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java @@ -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 sonePosts = sone.getPosts(); sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone)); Collections.sort(sonePosts, Post.TIME_COMPARATOR);