From 544587bac1ceb84f8d56452cd2a891be74439fa3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 4 May 2011 06:18:32 +0200 Subject: [PATCH] Return early if the Sone can not be found. NPE reported by saces and TheSeeker. --- src/main/java/net/pterodactylus/sone/web/ViewSonePage.java | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.7.4