File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/connectivity/http Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1515import okhttp3 .MediaType ;
1616import okhttp3 .OkHttpClient ;
1717import okhttp3 .RequestBody ;
18- import okhttp3 .Response ;
1918import okio .BufferedSink ;
2019import org .jetbrains .annotations .NotNull ;
2120import org .jetbrains .annotations .Nullable ;
@@ -78,6 +77,9 @@ private static class OkHttpResponse implements Response {
7877 private final okhttp3 .Response response ;
7978
8079 private OkHttpResponse (okhttp3 .Response response ) {
80+ if (response .body () == null ) {
81+ throw new IllegalStateException ();
82+ }
8183 this .response = response ;
8284 }
8385
@@ -93,10 +95,7 @@ public String statusMessage() {
9395
9496 @ Override
9597 public InputStream bodyInputStream () {
96- if (response .body () != null ) {
97- return response .body ().byteStream ();
98- }
99- throw new NullPointerException ();
98+ return response .body ().byteStream ();
10099 }
101100
102101 @ Override
You can’t perform that action at this time.
0 commit comments