Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / UnfollowSoneAjaxPage.java
index a285d20..1e87b15 100644 (file)
@@ -47,7 +47,7 @@ public class UnfollowSoneAjaxPage extends JsonPage {
                if (!webInterface.getCore().getSone(soneId).isPresent()) {
                        return createErrorJsonObject("invalid-sone-id");
                }
-               Sone currentSone = getCurrentSone(request.getToadletContext());
+               Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                if (currentSone == null) {
                        return createErrorJsonObject("auth-required");
                }