mirror of
https://github.com/bitwarden/android.git
synced 2025-01-13 03:37:33 +03:00
Added null check for loading non-existent policies (#753)
This commit is contained in:
parent
2b1d186611
commit
7edbf4ffc8
1 changed files with 4 additions and 0 deletions
|
@ -37,6 +37,10 @@ namespace Bit.Core.Services
|
||||||
var userId = await _userService.GetUserIdAsync();
|
var userId = await _userService.GetUserIdAsync();
|
||||||
var policies = await _storageService.GetAsync<Dictionary<string, PolicyData>>(
|
var policies = await _storageService.GetAsync<Dictionary<string, PolicyData>>(
|
||||||
string.Format(Keys_PoliciesPrefix, userId));
|
string.Format(Keys_PoliciesPrefix, userId));
|
||||||
|
if(policies == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
_policyCache = policies.Select(p => new Policy(policies[p.Key]));
|
_policyCache = policies.Select(p => new Policy(policies[p.Key]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue