Defensively handle UncheckedIOException cause (for NullAway compliance)

This commit is contained in:
Juergen Hoeller 2024-06-05 00:01:52 +02:00
parent f58c7d80cc
commit 6c054f88ea
1 changed files with 7 additions and 6 deletions

View File

@ -131,15 +131,16 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest
// Exceptions.ReactiveException is package private
Throwable cause = ex.getCause();
if (cause instanceof UncheckedIOException uioEx) {
return uioEx.getCause();
}
else if (cause instanceof IOException ioEx) {
if (cause instanceof IOException ioEx) {
return ioEx;
}
else {
return new IOException(ex.getMessage(), cause);
if (cause instanceof UncheckedIOException uioEx) {
IOException ioEx = uioEx.getCause();
if (ioEx != null) {
return ioEx;
}
}
return new IOException(ex.getMessage(), cause);
}