mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
Null check policies from SyncResponse before parsing (#767)
* Null check policies from SyncResponse before parsing * Update src/Core/Services/SyncService.cs formatting Co-Authored-By: Kyle Spearrin <kspearrin@users.noreply.github.com> Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
This commit is contained in:
parent
120e179fb8
commit
94216cf745
1 changed files with 2 additions and 1 deletions
|
@ -365,7 +365,8 @@ namespace Bit.Core.Services
|
||||||
|
|
||||||
private async Task SyncPolicies(List<PolicyResponse> response)
|
private async Task SyncPolicies(List<PolicyResponse> response)
|
||||||
{
|
{
|
||||||
var policies = response.ToDictionary(p => p.Id, p => new PolicyData(p));
|
var policies = response?.ToDictionary(p => p.Id, p => new PolicyData(p)) ??
|
||||||
|
new Dictionary<string, PolicyData>();
|
||||||
await _policyService.Replace(policies);
|
await _policyService.Replace(policies);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue