cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1082698 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Date Thu, 17 Mar 2011 21:06:42 GMT
Author: dkulp
Date: Thu Mar 17 21:06:42 2011
New Revision: 1082698

URL: http://svn.apache.org/viewvc?rev=1082698&view=rev
Log:
Add a NPE guard

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=1082698&r1=1082697&r2=1082698&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Thu Mar 17 21:06:42 2011
@@ -820,7 +820,12 @@ public class STSClient implements Config
         }
         CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
         cryptoType.setAlias(alias);
-        return crypto.getX509Certificates(cryptoType)[0];
+        
+        X509Certificate certs[] = crypto.getX509Certificates(cryptoType);
+        if (certs == null || certs.length == 0) {
+            throw new Fault("Could not get X509Certificate for alias " + alias, LOG);
+        }
+        return certs[0];
     }
 
     private void addLifetime(XMLStreamWriter writer) throws XMLStreamException {



Mime
View raw message