From: David ‘Bombe’ Roden Date: Sat, 13 Nov 2010 10:17:05 +0000 (+0100) Subject: Don’t create a new Sone when getting the logged in Sone. X-Git-Tag: 0.3-RC1~102 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c9dfdab1c3d57ebbce513ca437b52690a9f086ab;p=Sone.git Don’t create a new Sone when getting the logged in Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index 2953b0d..33c86a9 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -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); } /** diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java index 27fa081..8e7d27e 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java @@ -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); } //