Set apiGateway variable default to an empty object

This commit is contained in:
Philipp Muens 2019-05-08 14:13:28 +02:00
parent 76605ffc4b
commit 8a28024192

View File

@ -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) {