Skip to content

Commit ee787ce

Browse files
committed
properly handle empty data chunk
1 parent 701efbf commit ee787ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ios/ReactNativeBlobUtilFS.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ + (void) hash:(NSString *)path
679679
return;
680680
}
681681

682-
while ((dataChunk = [fileHandle readDataUpToLength:chunkSize error:&error])) {
682+
while ((dataChunk = [fileHandle readDataUpToLength:chunkSize error:&error]) && dataChunk.length > 0) {
683683
if (error) {
684684
return reject(@"EREAD", [NSString stringWithFormat:@"Error reading file '%@'", path], error);
685685
break;

0 commit comments

Comments
 (0)