Skip to content

Commit

Permalink
fix: metada access of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Lschulzes committed May 25, 2024
1 parent 9b6f87e commit d3f0b52
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions serverless-plugin/serverless-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ class ServerlessPlugin {
const funcConfig = func.slicWatch ?? {}
const functionLogicalId = awsProvider.naming.getLambdaLogicalId(funcName)
const templateResources = compiledTemplate.Resources as Record<string, Resource>
templateResources[functionLogicalId].Metadata = {
...templateResources[functionLogicalId].Metadata ?? {},
slicWatch: funcConfig
if (typeof templateResources[functionLogicalId] !== 'undefined') {
templateResources[functionLogicalId].Metadata = {
...templateResources[functionLogicalId].Metadata ?? {},
slicWatch: funcConfig
}
}
}

Expand Down

0 comments on commit d3f0b52

Please sign in to comment.