Skip to content

Commit c052a02

Browse files
committed
Ignore null message when introspecting resource cleanup failure
Closes gh-30597
1 parent 5ad853e commit c052a02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,11 @@ private Mono<Void> completeTransactionAfterThrowing(@Nullable ReactiveTransactio
10671067
* @param ex the throwable to try to unwrap
10681068
*/
10691069
private Throwable unwrapIfResourceCleanupFailure(Throwable ex) {
1070-
if (ex instanceof RuntimeException &&
1071-
ex.getCause() != null &&
1072-
ex.getMessage().startsWith("Async resource cleanup failed")) {
1073-
return ex.getCause();
1070+
if (ex instanceof RuntimeException && ex.getCause() != null) {
1071+
String msg = ex.getMessage();
1072+
if (msg != null && msg.startsWith("Async resource cleanup failed")) {
1073+
return ex.getCause();
1074+
}
10741075
}
10751076
return ex;
10761077
}

0 commit comments

Comments
 (0)