1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-31 17:57:43 +01:00

null check on policies response prop

This commit is contained in:
Kyle Spearrin 2020-03-12 15:16:22 -04:00
parent 72b4c4401a
commit 13d1067eda

View File

@ -306,9 +306,11 @@ export class SyncService implements SyncServiceAbstraction {
private async syncPolicies(response: PolicyResponse[]) {
const policies: { [id: string]: PolicyData; } = {};
response.forEach((p) => {
policies[p.id] = new PolicyData(p);
});
if (response != null) {
response.forEach((p) => {
policies[p.id] = new PolicyData(p);
});
}
return await this.policyService.replace(policies);
}
}