Browse Source

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
pull/30724/head
Sam Brannen 3 years ago
parent
commit
9ccbeec947
  1. 9
      spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionalOperatorImpl.java

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

@ -112,10 +112,11 @@ final class TransactionalOperatorImpl implements TransactionalOperator { @@ -112,10 +112,11 @@ final class TransactionalOperatorImpl implements TransactionalOperator {
* @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;
}

Loading…
Cancel
Save