Skip to content

Commit 40e3612

Browse files
authored
Merge branch 'joltup:master' into master
2 parents dccab7e + dcbde6f commit 40e3612

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
A project committed to making file access and data transfer easier and more efficient for React Native developers.
55

6+
# ⚠️ Unmaintained ⚠️
7+
68
# Version Compatibility Warning
79

810
rn-fetch-blob version 0.10.16 is only compatible with react native 0.60 and up. It should have been a major version bump, we apologize for the mistake. If you are not yet upgraded to react native 0.60 or above, you should remain on rn-fetch-blob version 0.10.15

android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,11 @@ private void done(Response resp) {
600600
if (responseBody != null) {
601601
String responseBodyString = null;
602602
try {
603-
responseBodyString = responseBody.string();
603+
boolean isBufferDataExists = responseBody.source().buffer().size() > 0;
604+
boolean isContentExists = responseBody.contentLength() > 0;
605+
if (isBufferDataExists && isContentExists) {
606+
responseBodyString = responseBody.string();
607+
}
604608
} catch(IOException exception) {
605609
exception.printStackTrace();
606610
}

0 commit comments

Comments
 (0)