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

Commit 20c0ccb

Browse files
committed
Fix fs.unlink incorrect exception when file not exists
1 parent ca0fd9f commit 20c0ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ios/RNFetchBlob/RNFetchBlob.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ - (NSDictionary *)constantsToExport
213213
NSError * error = nil;
214214
NSString * tmpPath = nil;
215215
[[NSFileManager defaultManager] removeItemAtPath:path error:&error];
216-
if(error == nil)
216+
if(error == nil || [[NSFileManager defaultManager] fileExistsAtPath:path] == NO)
217217
callback(@[[NSNull null]]);
218218
else
219219
callback(@[[NSString stringWithFormat:@"failed to unlink file or path at %@", path]]);

0 commit comments

Comments
 (0)