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:49 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x dddea5c0d -> ea1f8892e


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/ea1f8892
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/ea1f8892
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/ea1f8892

Branch: refs/heads/tomee-1.7.x
Commit: ea1f8892e9306dbd637c70bb670762491cf93f4f
Parents: dddea5c
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Mon Nov 17 15:01:42 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Mon Nov 17 15:01:42 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/ea1f8892/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 338e379..43022a6 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