Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / LogoutPage.java
index bc4c56d..e6d2980 100644 (file)
@@ -61,7 +61,7 @@ public class LogoutPage extends SoneTemplatePage {
                if (webInterface.getCore().getPreferences().isRequireFullAccess() && !toadletContext.isAllowedFullAccess()) {
                        return false;
                }
-               return (getCurrentSone(toadletContext, false) != null) && (webInterface.getCore().getLocalSones().size() != 1);
+               return getCurrentSone(toadletContext, false).isPresent() && (webInterface.getCore().getLocalSones().size() != 1);
        }
 
 }