cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/2] cxf-fediz git commit: Fixing NPE if no key alias
Date Wed, 20 Jul 2016 10:56:25 GMT
Fixing NPE if no key alias


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

Branch: refs/heads/master
Commit: 1a26bcf4f0b34f10c23d0ca46b9bec72a4a956df
Parents: d280bce
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Jul 20 11:56:13 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Jul 20 11:56:13 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1a26bcf4/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
index a1e2848..24d6be1 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
@@ -110,6 +110,10 @@ public final class CertsUtils {
             keyAlias = crypto.getDefaultX509Identifier();
         }
         
+        if (keyAlias == null) {
+            throw new RuntimeException("No keystore alias was specified to sign the metadata");
+        }
+        
         CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
         cryptoType.setAlias(keyAlias);
         X509Certificate[] issuerCerts = crypto.getX509Certificates(cryptoType);


Mime
View raw message