File tree 2 files changed +11
-1
lines changed
main/java/org/springframework/web/util
test/java/org/springframework/web/util
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 24
24
import org .apache .commons .logging .LogFactory ;
25
25
26
26
import org .springframework .core .NestedExceptionUtils ;
27
+ import org .springframework .lang .Nullable ;
27
28
import org .springframework .util .Assert ;
28
29
import org .springframework .util .ClassUtils ;
29
30
@@ -100,7 +101,11 @@ else if (logger.isDebugEnabled()) {
100
101
* <li>IOException "Broken pipe" or "connection reset by peer"
101
102
* </ul>
102
103
*/
103
- public static boolean isClientDisconnectedException (Throwable ex ) {
104
+ public static boolean isClientDisconnectedException (@ Nullable Throwable ex ) {
105
+ if (ex == null ) {
106
+ return false ;
107
+ }
108
+
104
109
Throwable currentEx = ex ;
105
110
Throwable lastEx = null ;
106
111
while (currentEx != null && currentEx != lastEx ) {
Original file line number Diff line number Diff line change @@ -90,4 +90,9 @@ void onwardClientDisconnectedExceptionType() {
90
90
assertThat (DisconnectedClientHelper .isClientDisconnectedException (ex )).isFalse ();
91
91
}
92
92
93
+ @ Test // gh-34533
94
+ void nullException () {
95
+ assertThat (DisconnectedClientHelper .isClientDisconnectedException (null )).isFalse ();
96
+ }
97
+
93
98
}
You can’t perform that action at this time.
0 commit comments