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=fe505095d58cce1522e7583826b532b1afb3c1f7;hb=93fdf9e218d808f65f618abbddce183191d8c15b;hpb=b04f97f923dcae625ee2aaa15491c75864936b82 diff --git a/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java b/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java index fe50509..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, false); - 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) {