cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/2] cxf git commit: Avoid some NPEs
Date Tue, 01 Dec 2015 14:04:32 GMT
Avoid some NPEs


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

Branch: refs/heads/master
Commit: 49b24fa300107366b1f47e9415dc418eafd820b6
Parents: 6d58c07
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Dec 1 12:11:12 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Dec 1 14:02:44 2015 +0000

----------------------------------------------------------------------
 .../cxf/rs/security/jose/common/KeyManagementUtils.java       | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/49b24fa3/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
index b18295a..79b1aed 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
@@ -236,11 +236,14 @@ public final class KeyManagementUtils {
                 LOG.warning("No keystore file has been configured");
                 throw new JoseException("No keystore file has been configured");
             }
-            keyStore = (KeyStore)m.getExchange().get(props.get(JoseConstants.RSSEC_KEY_STORE_FILE));
+            if (m != null) {
+                keyStore = (KeyStore)m.getExchange().get(props.get(JoseConstants.RSSEC_KEY_STORE_FILE));
+            }
         }
         
         if (keyStore == null) {
-            keyStore = loadKeyStore(props, m.getExchange().getBus());
+            Bus bus = m != null ? m.getExchange().getBus() : null;
+            keyStore = loadKeyStore(props, bus);
             if (m != null) {
                 m.getExchange().put((String)props.get(JoseConstants.RSSEC_KEY_STORE_FILE),
keyStore);
             }


Mime
View raw message