cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1133899 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
Date Thu, 09 Jun 2011 14:47:17 GMT
Author: coheigea
Date: Thu Jun  9 14:47:17 2011
New Revision: 1133899

URL: http://svn.apache.org/viewvc?rev=1133899&view=rev
Log:
Avoiding a NPE in the STS when creating a fault caused by a NPE

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java?rev=1133899&r1=1133898&r2=1133899&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
Thu Jun  9 14:47:17 2011
@@ -227,10 +227,12 @@ public class SecurityTokenServiceProvide
         } catch (Exception e) {
             try {
                 SOAPFault fault = soapFactory.createFault();
-                if (e.getMessage() == null) {
+                if (e.getMessage() != null) {
+                    fault.setFaultString(e.getMessage());
+                } else if (e.getCause() != null && e.getCause().getMessage() != null)
{
                     fault.setFaultString(e.getCause().getMessage());
                 } else {
-                    fault.setFaultString(e.getMessage());
+                    fault.setFaultString("Internal STS error");
                 }
                 Detail detail = fault.addDetail();
                 detail = fault.getDetail();



Mime
View raw message