diff --git a/src/index.ts b/src/index.ts index 8d63dd0..a55f05b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -188,6 +188,16 @@ class ServerlessOfflineSns { const topicArn = get(["Properties", "TopicArn", "Ref"], value); const topicName = get(["Properties", "TopicName"], resources[topicArn]); const fnName = this.getFunctionName(resourceName); + + if(!topicName){ + this.log(`${fnName} does not have a topic name, skipping`); + return; + } + + if(!fnName){ + this.log(`${topicName} does not have a function, skipping`); + return; + } subscriptions.push({ fnName, options: {