We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 768e03c + 9110ef2 commit d848b36Copy full SHA for d848b36
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
@@ -600,7 +600,11 @@ private void done(Response resp) {
600
if (responseBody != null) {
601
String responseBodyString = null;
602
try {
603
- responseBodyString = responseBody.string();
+ boolean isBufferDataExists = responseBody.source().buffer().size() > 0;
604
+ boolean isContentExists = responseBody.contentLength() > 0;
605
+ if (isBufferDataExists && isContentExists) {
606
+ responseBodyString = responseBody.string();
607
+ }
608
} catch(IOException exception) {
609
exception.printStackTrace();
610
}
0 commit comments