1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-26 16:57:59 +01:00

Added null check for loading non-existent policies (#753)

This commit is contained in:
Matt Portune 2020-03-03 10:53:03 -05:00 committed by GitHub
parent 2b1d186611
commit 7edbf4ffc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,10 @@ namespace Bit.Core.Services
var userId = await _userService.GetUserIdAsync();
var policies = await _storageService.GetAsync<Dictionary<string, PolicyData>>(
string.Format(Keys_PoliciesPrefix, userId));
if(policies == null)
{
return null;
}
_policyCache = policies.Select(p => new Policy(policies[p.Key]));
}