Skip to content

Commit

Permalink
fix(ios): check directory before call delete (#1066)
Browse files Browse the repository at this point in the history
Co-authored-by: Tommy Nguyen <[email protected]>
  • Loading branch information
camilossantos2809 and tido64 authored Feb 23, 2024
1 parent d02a31d commit 9db07c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/default-storage/ios/RNCAsyncStorage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ static dispatch_queue_t RCTGetMethodQueue()
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:RCTGetStorageDirectory() error:&error];
RCTHasCreatedStorageDirectory = NO;
return error ? RCTMakeError(@"Failed to delete storage directory.", error, nil) : nil;
if (error && error.code != NSFileNoSuchFileError) {
return RCTMakeError(@"Failed to delete storage directory.", error, nil);
}
return nil;
}

static NSDate *RCTManifestModificationDate(NSString *manifestFilePath)
Expand Down

0 comments on commit 9db07c8

Please sign in to comment.