Don’t create a new Sone when getting the logged in Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 13 Nov 2010 10:17:05 +0000 (11:17 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 13 Nov 2010 10:17:05 +0000 (11:17 +0100)
src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java
src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java

index 2953b0d..33c86a9 100644 (file)
@@ -137,7 +137,7 @@ public class SoneTemplatePage extends TemplatePage {
                if (soneId == null) {
                        return null;
                }
-               return webInterface.getCore().getLocalSone(soneId);
+               return webInterface.getCore().getLocalSone(soneId, false);
        }
 
        /**
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);
        }
 
        //