cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] cxf git commit: Avoid some NPEs
Date Tue, 01 Dec 2015 14:09:39 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes ba17570e5 -> c66b1a181


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

Branch: refs/heads/3.1.x-fixes
Commit: 82c4bff5276cc32490507fba4cb9d18539d41907
Parents: ba17570
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:04:46 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/82c4bff5/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