Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / CreateSonePage.java
index b2d4578..5c87ccb 100644 (file)
@@ -137,7 +137,7 @@ public class CreateSonePage 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);
        }
 
 }