Skip to content

Commit

Permalink
fix type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
t-richard committed Jun 20, 2021
1 parent 53d5089 commit 07e73ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ class LiftPlugin {
return;
}

if (this.serverless.service.provider.iam?.role?.statements !== undefined) {
this.serverless.service.provider.iam.role.statements.push(...statements);
const role = this.serverless.service.provider.iam?.role;

return;
if (typeof role === "object" && "statements" in role) {
role.statements?.push(...statements);
}

this.serverless.service.provider.iamRoleStatements = this.serverless.service.provider.iamRoleStatements ?? [];
Expand Down

0 comments on commit 07e73ee

Please sign in to comment.