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:28:04 UTC
[cxf] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 96133bc [CXF-7721] Adding few NPE guards
96133bc is described below
commit 96133bca4298b740f8fa46830854f7a5329fe8f3
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 3b12b60..6b71325 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.