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

Commit 1de74c1

Browse files
authored
Merge pull request #139 from kejinliang/master
Update RNFetchBlobNetwork.m
2 parents bd3ea93 + 5147545 commit 1de74c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "fetchblob-dev",
2+
"name": "react-native-fetch-blob",
33
"version": "0.9.5",
44
"private": true,
55
"scripts": {

src/ios/RNFetchBlobNetwork.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
285285
if(![fm fileExistsAtPath:folder]) {
286286
[fm createDirectoryAtPath:folder withIntermediateDirectories:YES attributes:NULL error:nil];
287287
}
288-
[fm createFileAtPath:destPath contents:[[NSData alloc] init] attributes:nil];
288+
if (![fm fileExistsAtPath:destPath]) {
289+
[fm createFileAtPath:destPath contents:[[NSData alloc] init] attributes:nil];
290+
}
289291
writeStream = [[NSOutputStream alloc] initToFileAtPath:destPath append:YES];
290292
[writeStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
291293
[writeStream open];

0 commit comments

Comments
 (0)