From 1a31c9d080f15faa3d762275f08d124435c7621a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 26 Jan 2013 11:41:18 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20call=20Optional.get()=20on=20pot?= =?utf8?q?entially=20non-existing=20instance.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/ViewPostPage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java index 50719ee..8adf46d 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java @@ -75,7 +75,7 @@ public class ViewPostPage extends SoneTemplatePage { String postId = request.getHttpRequest().getParam("post"); boolean raw = request.getHttpRequest().getParam("raw").equals("true"); Optional post = webInterface.getCore().getPost(postId); - templateContext.set("post", post.get()); + templateContext.set("post", post.orNull()); templateContext.set("raw", raw); } -- 2.7.4