Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit d4bbce7

Browse files
committed
Correct android download byte count #25
1 parent da0ac85 commit d4bbce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/android/src/main/java/com/RNFetchBlob/Response/RNFetchBlobDefaultResp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private class ProgressReportingSource implements Source {
6363
public long read(Buffer sink, long byteCount) throws IOException {
6464

6565
long read = mOriginalSource.read(sink, byteCount);
66-
bytesRead += read;
66+
bytesRead += read > 0 ? read : 0;
6767
WritableMap args = Arguments.createMap();
6868
args.putString("taskId", mTaskId);
6969
args.putString("written", String.valueOf(bytesRead));

0 commit comments

Comments
 (0)