Author: dkatayev
Date: 2010-02-04 10:49:29 -0500 (Thu, 04 Feb 2010)
New Revision: 1682
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/ThreadLocalSessionProviderService.java
Log:
EXOJCR-476 NullPointerException in ThreadLocalSessionProviderService fixed
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/ThreadLocalSessionProviderService.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/ThreadLocalSessionProviderService.java 2010-02-04
15:17:43 UTC (rev 1681)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/ThreadLocalSessionProviderService.java 2010-02-04
15:49:29 UTC (rev 1682)
@@ -51,9 +51,7 @@
*/
public SessionProvider getSessionProvider(Object key)
{
- if (sessionProviderKeeper.get() != null)
- return sessionProviderKeeper.get();
- return null;
+ return sessionProviderKeeper.get();
}
/**
@@ -86,8 +84,11 @@
*/
public void removeSessionProvider(Object key)
{
- getSessionProvider(key).close();
- sessionProviderKeeper.set(null);
+ if (sessionProviderKeeper.get() != null)
+ {
+ sessionProviderKeeper.get().close();
+ sessionProviderKeeper.set(null);
+ }
if (systemSessionProviderKeeper.get() != null)
{