Permalink
Browse files

Fix for the null session problem

  • Loading branch information...
1 parent 287947a commit af4018db7839d93378e28130f6c43daa704545dd @murz committed Mar 21, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/play/modules/fbconnect/FBConnectPlugin.java
@@ -12,14 +12,18 @@
private static ThreadLocal<FBConnectSession> _session = new ThreadLocal<FBConnectSession>();
public FBConnectSession session(){
- return _session.get();
+ FBConnectSession session = _session.get();
+ if(session == null){
+ session = new FBConnectSession();
+ session.init();
+ _session.set(session);
+ }
+ return session;
}
@Override
public void onApplicationStart() {
- FBConnectSession session = new FBConnectSession();
- session.init();
- _session.set(session);
+ session();
}
@Override

0 comments on commit af4018d

Please sign in to comment.