File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
main/java/org/springframework/web/util
test/java/org/springframework/web/util Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2424import org .apache .commons .logging .LogFactory ;
2525
2626import org .springframework .core .NestedExceptionUtils ;
27+ import org .springframework .lang .Nullable ;
2728import org .springframework .util .Assert ;
2829import org .springframework .util .ClassUtils ;
2930
@@ -100,7 +101,11 @@ else if (logger.isDebugEnabled()) {
100101 * <li>IOException "Broken pipe" or "connection reset by peer"
101102 * </ul>
102103 */
103- public static boolean isClientDisconnectedException (Throwable ex ) {
104+ public static boolean isClientDisconnectedException (@ Nullable Throwable ex ) {
105+ if (ex == null ) {
106+ return false ;
107+ }
108+
104109 Throwable currentEx = ex ;
105110 Throwable lastEx = null ;
106111 while (currentEx != null && currentEx != lastEx ) {
Original file line number Diff line number Diff line change @@ -90,4 +90,9 @@ void onwardClientDisconnectedExceptionType() {
9090 assertThat (DisconnectedClientHelper .isClientDisconnectedException (ex )).isFalse ();
9191 }
9292
93+ @ Test // gh-34533
94+ void nullException () {
95+ assertThat (DisconnectedClientHelper .isClientDisconnectedException (null )).isFalse ();
96+ }
97+
9398}
You can’t perform that action at this time.
0 commit comments