From a50e66faf4c3473e8efbcd475b08321d6e508aab Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Mon, 21 Sep 2020 18:34:22 +0200 Subject: [PATCH] Handle if GetState is null in biometric integrity check (#1082) --- src/iOS.Core/Services/BiometricService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/iOS.Core/Services/BiometricService.cs b/src/iOS.Core/Services/BiometricService.cs index 0dc960206..3126a8c10 100644 --- a/src/iOS.Core/Services/BiometricService.cs +++ b/src/iOS.Core/Services/BiometricService.cs @@ -17,7 +17,10 @@ namespace Bit.iOS.Core.Services public async Task SetupBiometricAsync() { var state = GetState(); - await _storageService.SaveAsync("biometricState", ToBase64(state)); + if (state != null) + { + await _storageService.SaveAsync("biometricState", ToBase64(state)); + } return true; } @@ -35,8 +38,12 @@ namespace Bit.iOS.Core.Services else { var state = GetState(); + if (state != null) + { + return FromBase64(oldState).Equals(state); + } - return FromBase64(oldState).Equals(state); + return true; } }