Add guard to ensure that body is non null
TypeScript was complianing a little later on when we tried to
Buffer.from `event.body` since it may be null.
MODIFY
aws-ts-slackbot/index.ts
aws-ts-slackbot/index.ts
@@ -76,7 +76,7 @@ const endpoint = new awsx.apigateway.API("mentionbot", {
throw new Error("mentionbot:verificationToken was not provided")
}
- if (!event.isBase64Encoded) {
+ if (!event.isBase64Encoded || event.body == null) {
console.log("Unexpected content received");
console.log(JSON.stringify(event));
}

Add guard to ensure that body is non null

TypeScript was complianing a little later on when we tried to
Buffer.from `event.body` since it may be null.