Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check directory before call delete on iOS #1066

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/default-storage/ios/RNCAsyncStorage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ static dispatch_queue_t RCTGetMethodQueue()
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:RCTGetStorageDirectory() error:&error];
RCTHasCreatedStorageDirectory = NO;
if (error.code == NSFileNoSuchFileError) {
return nil;
}
return error ? RCTMakeError(@"Failed to delete storage directory.", error, nil) : nil;
camilossantos2809 marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
Loading