mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 08:13:20 +00: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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user