X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDistrustPage.java;h=e0ec3fb10aa2c306204bf53e6219e2f4bf57e11b;hb=53a71d1d6b91e4d56af49a06f2e06bc4d11bf3eb;hp=262d60254c9a2598f9a32c10c73f53f49757280f;hpb=8f02544d31f323ae9053dd9a11a99eacd8cf5bcd;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/DistrustPage.java b/src/main/java/net/pterodactylus/sone/web/DistrustPage.java index 262d602..e0ec3fb 100644 --- a/src/main/java/net/pterodactylus/sone/web/DistrustPage.java +++ b/src/main/java/net/pterodactylus/sone/web/DistrustPage.java @@ -17,6 +17,8 @@ package net.pterodactylus.sone.web; +import com.google.common.base.Optional; + import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.page.FreenetRequest; @@ -58,10 +60,10 @@ 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 sone = webInterface.getCore().getSone(identity); - if (sone != null) { - webInterface.getCore().distrustSone(currentSone, sone); + Sone currentSone = getCurrentSone(request.getToadletContext()).get(); + Optional sone = webInterface.getCore().getSone(identity); + if (sone.isPresent()) { + webInterface.getCore().distrustSone(currentSone, sone.get()); } throw new RedirectException(returnPage); }