From a0bb16c35f53ed2d14b8d5b131e7d530ae110ed9 Mon Sep 17 00:00:00 2001 From: Matt Portune <59324545+mportune-bw@users.noreply.github.com> Date: Thu, 14 Oct 2021 13:53:57 -0400 Subject: [PATCH] fix for crash on startup when policies are non-existent (#1579) --- src/Core/Services/PolicyService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Core/Services/PolicyService.cs b/src/Core/Services/PolicyService.cs index 5214e6637..95529ab26 100644 --- a/src/Core/Services/PolicyService.cs +++ b/src/Core/Services/PolicyService.cs @@ -201,6 +201,10 @@ namespace Bit.Core.Services public async Task PolicyAppliesToUser(PolicyType policyType, Func policyFilter) { var policies = await GetAll(policyType); + if (policies == null) + { + return false; + } var organizations = await _userService.GetAllOrganizationAsync(); IEnumerable filteredPolicies;