Skip to content

Commit

Permalink
Ignore null message when introspecting resource cleanup failure
Browse files Browse the repository at this point in the history
This commit fixes a regression introduced in conjunction with spring-projectsgh-27572.

See spring-projectsgh-30597
Closes spring-projectsgh-30729
  • Loading branch information
sbrannen authored and mdeinum committed Jun 29, 2023
1 parent 06bc03e commit 80a42f9
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -112,10 +112,11 @@ private Mono<Void> rollbackOnException(ReactiveTransaction status, Throwable ex)
* @param ex the throwable to try to unwrap
*/
private Throwable unwrapIfResourceCleanupFailure(Throwable ex) {
if (ex instanceof RuntimeException &&
ex.getCause() != null &&
ex.getMessage().startsWith("Async resource cleanup failed")) {
return ex.getCause();
if (ex instanceof RuntimeException && ex.getCause() != null) {
String msg = ex.getMessage();
if (msg != null && msg.startsWith("Async resource cleanup failed")) {
return ex.getCause();
}
}
return ex;
}
Expand Down

0 comments on commit 80a42f9

Please sign in to comment.