isClientDisconnectedException needs to protect against null input #34533
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: regression
A bug that is also a regression
Milestone
Spring-Web v6.2.3 of introduced changes within
WebAsyncManager
to wrap client disconnection errors in #34363, but these changes within the throwable consumer are not null-safe asDisconnectedClientHelper.isClientDisconnectedException(ex)
never checks if the exception is null. This causes a NullPointerException when executingNestedExceptionUtils.getMostSpecificCause(ex).getMessage()
withinisClientDisconnectedException()
.Mentioned code changes
Maybe the error was introduced by the incorrect JavaDoc of
NestedExceptionUtils.getMostSpecificCause(Throwable original)
, which can in fact return null if the original exception was also null.This NPE does not affect the behavior for the client, but causes a lot of warn-logs, as the NPE is caught by Tomcats
AsyncContextImpl
:v6.2.1 and prior are able to correctly process
null
values in their error handler implemented inWebAsyncManager
, so I assume this is an unwanted side effect.The text was updated successfully, but these errors were encountered: