We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1933faf + 4ff2d8a commit 9110ef2Copy full SHA for 9110ef2
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