Skip to content

Commit 9ccbeec

Browse files
committed
Ignore null message when introspecting resource cleanup failure
This commit fixes a regression introduced in conjunction with gh-27572. See gh-30597 Closes gh-30729
1 parent 29248df commit 9ccbeec

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionalOperatorImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ private Mono<Void> rollbackOnException(ReactiveTransaction status, Throwable ex)
112112
* @param ex the throwable to try to unwrap
113113
*/
114114
private Throwable unwrapIfResourceCleanupFailure(Throwable ex) {
115-
if (ex instanceof RuntimeException &&
116-
ex.getCause() != null &&
117-
ex.getMessage().startsWith("Async resource cleanup failed")) {
118-
return ex.getCause();
115+
if (ex instanceof RuntimeException && ex.getCause() != null) {
116+
String msg = ex.getMessage();
117+
if (msg != null && msg.startsWith("Async resource cleanup failed")) {
118+
return ex.getCause();
119+
}
119120
}
120121
return ex;
121122
}

0 commit comments

Comments
 (0)