Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / DeleteProfileFieldAjaxPage.java
index cb33fb9..97393f2 100644 (file)
@@ -51,7 +51,7 @@ public class DeleteProfileFieldAjaxPage extends JsonPage {
        @Override
        protected JsonReturnObject createJsonObject(FreenetRequest request) {
                String fieldId = request.getHttpRequest().getParam("field");
-               Sone currentSone = getCurrentSone(request.getToadletContext());
+               Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                Profile profile = currentSone.getProfile();
                Field field = profile.getFieldById(fieldId);
                if (field == null) {