Don’t create a new Sone when getting the logged in Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / JsonPage.java
index 27fa081..8e7d27e 100644 (file)
@@ -112,12 +112,7 @@ public abstract class JsonPage implements Page {
                if (soneId == null) {
                        return null;
                }
-               for (Sone sone : webInterface.getCore().getSones()) {
-                       if (sone.getId().equals(soneId)) {
-                               return sone;
-                       }
-               }
-               return null;
+               return webInterface.getCore().getLocalSone(soneId, false);
        }
 
        //