Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / UploadImagePage.java
index 5e23a78..27e9cc8 100644 (file)
@@ -81,7 +81,7 @@ public class UploadImagePage extends SoneTemplatePage {
        protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                super.processTemplate(request, templateContext);
                if (request.getMethod() == Method.POST) {
-                       Sone currentSone = getCurrentSone(request.getToadletContext());
+                       Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                        String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36);
                        Album parent = webInterface.getCore().getAlbum(parentId);
                        if (parent == null) {