You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2018/04/20 16:38:59 UTC

[cxf] branch 3.1.x-fixes updated: [CXF-7721] Adding few NPE guards

This is an automated email from the ASF dual-hosted git repository.

sergeyb pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new cde1712  [CXF-7721] Adding few NPE guards
cde1712 is described below

commit cde17127eabfd007e63f82aca59edca240594029
Author: Sergey Beryozkin <sb...@gmail.com>
AuthorDate: Fri Apr 20 17:27:45 2018 +0100

    [CXF-7721] Adding few NPE guards
---
 .../src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
index 876b138..77de06f 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
@@ -245,7 +245,7 @@ public final class JwkUtils {
     public static JsonWebKeys loadJwkSet(Message m, Properties props, PrivateKeyPasswordProvider cb) {
         String key = (String)props.get(JoseConstants.RSSEC_KEY_STORE_FILE);
         JsonWebKeys jwkSet = null;
-        if (key != null) {
+        if (key != null && m != null) {
             Object jwkSetProp = m.getExchange().get(key);
             if (jwkSetProp != null && !(jwkSetProp instanceof JsonWebKeys)) {
                 throw new JwkException("Unexpected key store class: " + jwkSetProp.getClass().getName());
@@ -254,8 +254,8 @@ public final class JwkUtils {
             }
         }
         if (jwkSet == null) {
-            jwkSet = loadJwkSet(props, m.getExchange().getBus(), cb);
-            if (key != null) {
+            jwkSet = loadJwkSet(props, m != null ? m.getExchange().getBus() : null, cb);
+            if (key != null && m != null) {
                 m.getExchange().put(key, jwkSet);
             }
         }

-- 
To stop receiving notification emails like this one, please contact
sergeyb@apache.org.