X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FFollowSoneAjaxPage.java;h=c3943263ac03376e48639028b99cde1e7c2e9f0c;hb=0aa389b2493e19484530698e2ce056372dc2a1e9;hp=64c402aba0540dc529b93fb7c7beae9ad7782167;hpb=c842faebb65eb5210de8f6a2d0be85307d0c163f;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java index 64c402a..c394326 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java @@ -19,6 +19,7 @@ package net.pterodactylus.sone.web.ajax; import com.google.common.base.Optional; +import net.pterodactylus.sone.data.LocalSone; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.sone.web.page.FreenetRequest; @@ -50,10 +51,7 @@ public class FollowSoneAjaxPage extends JsonPage { if (!sone.isPresent()) { return createErrorJsonObject("invalid-sone-id"); } - Sone currentSone = getCurrentSone(request.getToadletContext()); - if (currentSone == null) { - return createErrorJsonObject("auth-required"); - } + LocalSone currentSone = getCurrentSone(request.getToadletContext()).get(); webInterface.getCore().followSone(currentSone, soneId); webInterface.getCore().markSoneKnown(sone.get()); return createSuccessJsonObject();