X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSoneTemplatePage.java;h=40785856460d1904391a379d0a1018e4c38a3f33;hb=00adeb7e4a42365d0b5feb4e38338285e91a2301;hp=d6f1eb75e1d46b27cf5004f7d521fae9d7af6747;hpb=7da3ac7e3aa5eabbbfccf7eb0549e94d48a44cf5;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 d6f1eb7..4078585 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -110,7 +110,13 @@ public class SoneTemplatePage extends TemplatePage { if (session == null) { return null; } - return (Sone) session.getAttribute("Sone.CurrentSone"); + String soneId = (String) session.getAttribute("Sone.CurrentSone"); + for (Sone sone : webInterface.core().localSones()) { + if (sone.getId().equals(soneId)) { + return sone; + } + } + return null; } /** @@ -123,7 +129,7 @@ public class SoneTemplatePage extends TemplatePage { */ protected void setCurrentSone(ToadletContext toadletContext, Sone sone) { Session session = getCurrentSession(toadletContext); - session.setAttribute("Sone.CurrentSone", sone); + session.setAttribute("Sone.CurrentSone", sone.getId()); } //