mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-25 12:05:59 +01: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
@ -365,7 +365,8 @@ namespace Bit.Core.Services
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user