From 94216cf745843a57ab38908ac92287ee8857105c Mon Sep 17 00:00:00 2001 From: Matt Portune <59324545+mportune-bw@users.noreply.github.com> Date: Thu, 12 Mar 2020 15:45:34 -0400 Subject: [PATCH] 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 Co-authored-by: Kyle Spearrin --- src/Core/Services/SyncService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/Services/SyncService.cs b/src/Core/Services/SyncService.cs index cfb175f84..9a739d500 100644 --- a/src/Core/Services/SyncService.cs +++ b/src/Core/Services/SyncService.cs @@ -365,7 +365,8 @@ namespace Bit.Core.Services private async Task SyncPolicies(List 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(); await _policyService.Replace(policies); } }