Skip to content

Commit

Permalink
Fixing processing exceptions with null message
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Feb 9, 2016
1 parent 7992bbb commit 69dfcd7
Showing 1 changed file with 6 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -447,7 +447,11 @@ private static void addAllExceptionsToMessage(StringBuilder sb, Throwable ex) {
sb.append("(");
// Make sure that no non-printable chars shall pass
// e.g. AD LDAP produces non-printable chars in the messages
sb.append(ex.getMessage().replaceAll("\\p{C}", "?"));
if (ex.getMessage() == null) {
sb.append("null");
} else {
sb.append(ex.getMessage().replaceAll("\\p{C}", "?"));
}
sb.append(")");
if (ex.getCause() != null) {
sb.append("->");
Expand Down

0 comments on commit 69dfcd7

Please sign in to comment.