Repository: cxf Updated Branches: refs/heads/master 7fbbd1d13 -> b9ebd26d1
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/b9ebd26d Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b9ebd26d Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b9ebd26d Branch: refs/heads/master Commit: b9ebd26d181cd31b124f384f29d8946512935335 Parents: 7fbbd1d Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Fri Aug 28 15:55:51 2015 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Fri Aug 28 15:55:51 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/b9ebd26d/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 9af0957..182730a 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 @@ -259,7 +259,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); }