diff --git a/lib/actions/StageCreate.js b/lib/actions/StageCreate.js index 15f9c47a284..220719ebb59 100644 --- a/lib/actions/StageCreate.js +++ b/lib/actions/StageCreate.js @@ -204,8 +204,8 @@ usage: serverless stage create`, // Select A Profile _this.profiles = _this.provider.getAllProfiles(); - - if (!_this.profiles) throw new SError(`You have no profiles for ${_this.provider.getProviderName()} on this machine. Please re-run this command and create a new profile.`); + + if (Object.keys(_this.profiles).length === 0) throw new SError(`You have no profiles for ${_this.provider.getProviderName()} on this machine. Please re-run this command and create a new profile.`); // Prompt: profile select let choices = [];