Skip to content

Commit

Permalink
Ignore null message when introspecting resource cleanup failure
Browse files Browse the repository at this point in the history
Closes gh-30597
  • Loading branch information
jhoeller committed Jun 7, 2023
1 parent 5ad853e commit c052a02
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,11 @@ private Mono<Void> completeTransactionAfterThrowing(@Nullable ReactiveTransactio
* @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 c052a02

Please sign in to comment.