X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSoneTemplatePage.java;h=496fb60a77b4104f37abe95aab782fb726d8f5aa;hb=a9aafa22d72dd596f4686cda7fe2f17074235394;hp=f38e845c69ad7d517eeced953eb614fbc7300caf;hpb=8127a3d7f17b0740254a5935de97fa03312a4efd;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index f38e845..496fb60 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -109,15 +109,11 @@ public class SoneTemplatePage extends TemplatePage { * session */ protected Session getCurrentSession(ToadletContext toadletContenxt, boolean create) { - try { - Session session = webInterface.getSessionManager().useSession(toadletContenxt); - if (create && (session == null)) { - session = webInterface.getSessionManager().createSession(UUID.randomUUID().toString(), toadletContenxt); - } - return session; - } catch (freenet.clients.http.RedirectException re1) { - return null; + Session session = webInterface.getSessionManager().useSession(toadletContenxt); + if (create && (session == null)) { + session = webInterface.getSessionManager().createSession(UUID.randomUUID().toString(), toadletContenxt); } + return session; } /** @@ -137,12 +133,7 @@ public class SoneTemplatePage extends TemplatePage { if (soneId == null) { return null; } - for (Sone sone : webInterface.core().getSones()) { - if (sone.getId().equals(soneId)) { - return sone; - } - } - return null; + return webInterface.getCore().getLocalSone(soneId, false); } /**