From 8a28024192e775bd4efebbf3eecc66b4443ac1e0 Mon Sep 17 00:00:00 2001 From: Philipp Muens Date: Wed, 8 May 2019 14:13:28 +0200 Subject: [PATCH] Set apiGateway variable default to an empty object --- .../aws/package/compile/events/apiGateway/lib/restApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/aws/package/compile/events/apiGateway/lib/restApi.js b/lib/plugins/aws/package/compile/events/apiGateway/lib/restApi.js index 83699a98b..7681b8200 100644 --- a/lib/plugins/aws/package/compile/events/apiGateway/lib/restApi.js +++ b/lib/plugins/aws/package/compile/events/apiGateway/lib/restApi.js @@ -5,7 +5,7 @@ const BbPromise = require('bluebird'); module.exports = { compileRestApi() { - const apiGateway = this.serverless.service.provider.apiGateway; + const apiGateway = this.serverless.service.provider.apiGateway || {}; // immediately return if we're using an external REST API id if (apiGateway && apiGateway.restApiId) {