Skip to content

Commit

Permalink
Merge pull request #118 from Lschulzes/lschulzes-fix/metadata
Browse files Browse the repository at this point in the history
fix: trying to read `Metadata` of undefined
  • Loading branch information
eoinsha authored Jun 10, 2024
2 parents 9b6f87e + d3f0b52 commit fd4853e
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 fd4853e

Please sign in to comment.