cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: NPE fix when exception is null
Date Fri, 28 Aug 2015 14:58:47 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes f3d875215 -> 7ae54f4cc


NPE fix when exception is null


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

Branch: refs/heads/3.0.x-fixes
Commit: 7ae54f4cc76c5a10adddcfd7b1d25628b39178a8
Parents: f3d8752
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Aug 28 15:55:51 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Aug 28 15:56:35 2015 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7ae54f4c/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
index 01169b7..5457a8d 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
@@ -238,7 +238,11 @@ public abstract class AbstractSamlInHandler implements ContainerRequestFilter
{
     protected void throwFault(String error, Exception ex) {
         // TODO: get bundle resource message once this filter is moved 
         // to rt/rs/security
-        LOG.warning(error + ": " + ExceptionUtils.getStackTrace(ex));
+        String errorMsg = error;
+        if (ex != null) {
+            errorMsg += ": " + ExceptionUtils.getStackTrace(ex);
+        }
+        LOG.warning(errorMsg);
         Response response = JAXRSUtils.toResponseBuilder(401).entity(error).build();
         throw ExceptionUtils.toNotAuthorizedException(null, response);
     }


Mime
View raw message