mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
catch InteractionNotAllowed
This commit is contained in:
parent
011f04e1dc
commit
421834153d
1 changed files with 3 additions and 3 deletions
|
@ -34,9 +34,9 @@ namespace Bit.iOS.Core.Services
|
||||||
var formattedKey = string.Format(_keyFormat, appId, key);
|
var formattedKey = string.Format(_keyFormat, appId, key);
|
||||||
byte[] dataBytes = null;
|
byte[] dataBytes = null;
|
||||||
using(var existingRecord = GetKeyRecord(formattedKey))
|
using(var existingRecord = GetKeyRecord(formattedKey))
|
||||||
using(var record = SecKeyChain.QueryAsRecord(existingRecord, out SecStatusCode resultCode))
|
using(var record = SecKeyChain.QueryAsRecord(existingRecord, out var resultCode))
|
||||||
{
|
{
|
||||||
if(resultCode == SecStatusCode.ItemNotFound)
|
if(resultCode == SecStatusCode.ItemNotFound || resultCode == SecStatusCode.InteractionNotAllowed)
|
||||||
{
|
{
|
||||||
return (T)(object)null;
|
return (T)(object)null;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ namespace Bit.iOS.Core.Services
|
||||||
private SecRecord GetExistingRecord(string key)
|
private SecRecord GetExistingRecord(string key)
|
||||||
{
|
{
|
||||||
var existingRecord = GetKeyRecord(key);
|
var existingRecord = GetKeyRecord(key);
|
||||||
SecKeyChain.QueryAsRecord(existingRecord, out SecStatusCode resultCode);
|
SecKeyChain.QueryAsRecord(existingRecord, out var resultCode);
|
||||||
return resultCode == SecStatusCode.Success ? existingRecord : null;
|
return resultCode == SecStatusCode.Success ? existingRecord : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue