Skip to content

Commit e4b4512

Browse files
committed
Update code due to change in nullability contract
See gh-34933
1 parent db5809f commit e4b4512

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-web/src/main/java/org/springframework/http/client/SimpleClientHttpResponse.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.io.IOException;
2020
import java.io.InputStream;
2121
import java.net.HttpURLConnection;
22+
import java.util.Objects;
2223

2324
import org.springframework.http.HttpHeaders;
2425
import org.springframework.http.HttpStatusCode;
@@ -103,6 +104,7 @@ public void close() {
103104
if (this.responseStream == null) {
104105
getBody();
105106
}
107+
Objects.requireNonNull(this.responseStream);
106108
StreamUtils.drain(this.responseStream);
107109
this.responseStream.close();
108110
}

0 commit comments

Comments
 (0)