From 7edbf4ffc857e71dc0b51fdc5014bf2975f27eac Mon Sep 17 00:00:00 2001 From: Matt Portune <59324545+mportune-bw@users.noreply.github.com> Date: Tue, 3 Mar 2020 10:53:03 -0500 Subject: [PATCH] Added null check for loading non-existent policies (#753) --- src/Core/Services/PolicyService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Core/Services/PolicyService.cs b/src/Core/Services/PolicyService.cs index 297f4db08..f4f1bf041 100644 --- a/src/Core/Services/PolicyService.cs +++ b/src/Core/Services/PolicyService.cs @@ -37,6 +37,10 @@ namespace Bit.Core.Services var userId = await _userService.GetUserIdAsync(); var policies = await _storageService.GetAsync>( string.Format(Keys_PoliciesPrefix, userId)); + if(policies == null) + { + return null; + } _policyCache = policies.Select(p => new Policy(policies[p.Key])); }