Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[Secure storage] iOS don't throw exception when removing key that doesn't exist #562

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ SecRecord CreateRecordForNewKeyValue(string key, string value, string service)
bool RemoveRecord(SecRecord record)
{
var result = SecKeyChain.Remove(record);
if (result != SecStatusCode.Success)
throw new Exception(string.Format($"Error removing record: {result}"));
if (result != SecStatusCode.Success && result != SecStatusCode.ItemNotFound)
throw new Exception($"Error removing record: {result}");

return true;
}
Expand Down