X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FMarkAsKnownPage.java;h=04ad3043474eeefbcb34f29348071d53f716e5e7;hp=0bf5285323eaa313b65a0b775025d279f446eb2c;hb=93fdf9e218d808f65f618abbddce183191d8c15b;hpb=3b751d0c053450961bb66d2507d6187ce56f8785 diff --git a/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java b/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java index 0bf5285..04ad304 100644 --- a/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java +++ b/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java @@ -27,6 +27,8 @@ import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; +import com.google.common.base.Optional; + /** * Page that lets the user mark a number of {@link Sone}s, {@link Post}s, or * {@link Reply Replie}s as known. @@ -71,11 +73,11 @@ public class MarkAsKnownPage extends SoneTemplatePage { } webInterface.getCore().markPostKnown(post); } else if (type.equals("reply")) { - PostReply reply = webInterface.getCore().getPostReply(id); - if (reply == null) { + Optional reply = webInterface.getCore().getPostReply(id); + if (!reply.isPresent()) { continue; } - webInterface.getCore().markReplyKnown(reply); + webInterface.getCore().markReplyKnown(reply.get()); } else if (type.equals("sone")) { Sone sone = webInterface.getCore().getSone(id, false); if (sone == null) {