Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / FollowSoneAjaxPage.java
index 64c402a..3b51df2 100644 (file)
@@ -50,10 +50,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");
-               }
+               Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                webInterface.getCore().followSone(currentSone, soneId);
                webInterface.getCore().markSoneKnown(sone.get());
                return createSuccessJsonObject();