* The currently logged in Sone (to store in the template)
* @return The JSON representation of the post
*/
- private JsonNode createJsonPost(FreenetRequest request, Post post, Sone currentSone) {
+ private JsonNode createJsonPost(FreenetRequest request, Post post, Optional<Sone> currentSone) {
ObjectNode jsonPost = new ObjectNode(instance);
jsonPost.put("id", post.getId());
jsonPost.put("sone", post.getSone().getId());
templateContext.set("core", webInterface.getCore());
templateContext.set("request", request);
templateContext.set("post", post);
- templateContext.set("currentSone", currentSone);
+ templateContext.set("currentSone", currentSone.orNull());
templateContext.set("localSones", webInterface.getCore().getLocalSones());
try {
postTemplate.render(templateContext, stringWriter);