X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetReplyAjaxPage.java;h=14d96eeb6fb91a11480523ed7f7684d061570e58;hb=fd88107b013522d7620f5297386472206f320e10;hp=251c78432bf2f99628b86f33cde1ea03bc829c53;hpb=9fbafff8f3467329e7c8ad24d5d13273962ade28;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java index 251c784..14d96ee 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java @@ -22,8 +22,8 @@ import static com.fasterxml.jackson.databind.node.JsonNodeFactory.instance; import com.google.common.base.Optional; +import net.pterodactylus.sone.data.LocalSone; import net.pterodactylus.sone.data.PostReply; -import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.io.Closer; @@ -97,7 +97,7 @@ public class GetReplyAjaxPage extends JsonPage { * The currently logged in Sone (to store in the template) * @return The JSON representation of the reply */ - private JsonNode createJsonReply(FreenetRequest request, PostReply reply, Sone currentSone) { + private JsonNode createJsonReply(FreenetRequest request, PostReply reply, Optional currentSone) { ObjectNode jsonReply = new ObjectNode(instance); jsonReply.put("id", reply.getId()); jsonReply.put("postId", reply.getPostId()); @@ -108,7 +108,7 @@ public class GetReplyAjaxPage extends JsonPage { templateContext.set("core", webInterface.getCore()); templateContext.set("request", request); templateContext.set("reply", reply); - templateContext.set("currentSone", currentSone); + templateContext.set("currentSone", currentSone.orNull()); try { replyTemplate.render(templateContext, stringWriter); } catch (TemplateException te1) {