Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / DistrustPage.java
index c8879a0..e0ec3fb 100644 (file)
@@ -60,7 +60,7 @@ public class DistrustPage extends SoneTemplatePage {
                if (request.getMethod() == Method.POST) {
                        String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
                        String identity = request.getHttpRequest().getPartAsStringFailsafe("sone", 44);
-                       Sone currentSone = getCurrentSone(request.getToadletContext());
+                       Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                        Optional<Sone> sone = webInterface.getCore().getSone(identity);
                        if (sone.isPresent()) {
                                webInterface.getCore().distrustSone(currentSone, sone.get());