Fix NPE in RepeatTemplate

Resolves #1123
This commit is contained in:
Mahmoud Ben Hassine
2023-11-20 15:10:30 +01:00
parent dcd1ac8b52
commit 03d28330c2

View File

@@ -286,8 +286,15 @@ public class RepeatTemplate implements RepeatOperations {
}
if (logger.isDebugEnabled()) {
logger.debug("Handling exception: " + throwable.getClass().getName() + ", caused by: "
+ unwrappedThrowable.getClass().getName() + ": " + unwrappedThrowable.getMessage());
StringBuilder message = new StringBuilder("Handling exception: ")
.append(throwable.getClass().getName());
if (unwrappedThrowable != null) {
message.append(", caused by: ")
.append(unwrappedThrowable.getClass().getName())
.append(": ")
.append(unwrappedThrowable.getMessage());
}
logger.debug(message.toString());
}
exceptionHandler.handleException(context, unwrappedThrowable);