tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: avoid NPE
Date Mon, 17 Nov 2014 13:59:40 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop 3222d017e -> af5b154c6


avoid NPE


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

Branch: refs/heads/develop
Commit: af5b154c64f22ddcdd17c9a64434e630a9db6363
Parents: 3222d01
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Mon Nov 17 14:59:23 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Mon Nov 17 14:59:23 2014 +0100

----------------------------------------------------------------------
 .../apache/openejb/core/security/AbstractSecurityService.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/af5b154c/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
index 674d052..2969a92 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
@@ -267,6 +267,10 @@ public abstract class AbstractSecurityService implements SecurityService<UUID>,
     @Override
     public Principal getCallerPrincipal() {
         final ThreadContext threadContext = ThreadContext.getThreadContext();
+        if (threadContext == null) {
+            return null;
+        }
+
         final SecurityContext securityContext = threadContext.get(SecurityContext.class);
         final Set<Principal> principals = securityContext.subject.getPrincipals();
 


Mime
View raw message