Newest fred does not throw anymore.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 23 Nov 2010 08:51:45 +0000 (09:51 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 23 Nov 2010 08:51:45 +0000 (09:51 +0100)
src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java
src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java

index 33c86a9..496fb60 100644 (file)
@@ -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;
        }
 
        /**
index b9bdc77..4fb885d 100644 (file)
@@ -84,15 +84,11 @@ public abstract class JsonPage implements Page {
         *         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;
        }
 
        /**