fix for crash on startup when policies are non-existent (#1579)

This commit is contained in:
Matt Portune 2021-10-14 13:53:57 -04:00 committed by GitHub
parent 62a8d1c017
commit a0bb16c35f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,6 +201,10 @@ namespace Bit.Core.Services
public async Task<bool> PolicyAppliesToUser(PolicyType policyType, Func<Policy, bool> policyFilter)
{
var policies = await GetAll(policyType);
if (policies == null)
{
return false;
}
var organizations = await _userService.GetAllOrganizationAsync();
IEnumerable<Policy> filteredPolicies;