From 35d1c83acd0c4183be8a60e80f44bc0198b25f16 Mon Sep 17 00:00:00 2001 From: Domagoj Medo Date: Thu, 25 Oct 2018 16:14:12 +0200 Subject: [PATCH] iOS don't throw exception when removing key that doesn't exist --- Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs b/Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs index 5e5fbc974..44c5725b9 100644 --- a/Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs +++ b/Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs @@ -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; }