tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: another NPE check
Date Mon, 17 Nov 2014 14:01:39 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop af5b154c6 -> 7d60b1603


another NPE check


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/7d60b160
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/7d60b160
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/7d60b160

Branch: refs/heads/develop
Commit: 7d60b1603ec58d5f8ba23d957204385709e41961
Parents: af5b154
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Mon Nov 17 15:01:32 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Mon Nov 17 15:01:32 2014 +0100

----------------------------------------------------------------------
 .../org/apache/openejb/rest/ThreadLocalSecurityContext.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/7d60b160/container/openejb-core/src/main/java/org/apache/openejb/rest/ThreadLocalSecurityContext.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/rest/ThreadLocalSecurityContext.java
b/container/openejb-core/src/main/java/org/apache/openejb/rest/ThreadLocalSecurityContext.java
index 6887d80..56e2103 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/rest/ThreadLocalSecurityContext.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/rest/ThreadLocalSecurityContext.java
@@ -41,7 +41,10 @@ public class ThreadLocalSecurityContext extends AbstractRestThreadLocalProxy<Sec
     public Principal getUserPrincipal() {
         final Principal callerPrincipal = service().getCallerPrincipal();
         if (callerPrincipal == null) {
-            return get().getUserPrincipal();
+            final SecurityContext securityContext = get();
+            if (securityContext != null) {
+                return securityContext.getUserPrincipal();
+            }
         }
         return callerPrincipal;
     }


Mime
View raw message