Skip to content

Commit

Permalink
fix: add missing check for undefined (#6543)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhockett authored Feb 3, 2021
1 parent 989624e commit 31b980d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ async function determineAuthFlow(context: $TSContext, projectConfig?: ProjectCon
{},
);

if (context.exeInfo.inputParams.yes) {
if (context?.exeInfo?.inputParams?.yes) {
if (process.env.AWS_SDK_LOAD_CONFIG) {
useProfile = useProfile === undefined ? true : useProfile;
profileName = profileName || process.env.AWS_PROFILE || 'default';
Expand Down Expand Up @@ -756,7 +756,7 @@ async function determineAuthFlow(context: $TSContext, projectConfig?: ProjectCon
return { ...awsConfig, type: 'accessKeys' };
}

if (context.exeInfo.inputParams.yes) {
if (context?.exeInfo?.inputParams?.yes) {
const errorMessage = 'Failed to resolve AWS access keys with --yes flag.';
const docsUrl = 'https://docs.amplify.aws/cli/usage/headless';
context.print.error(errorMessage);
Expand Down

0 comments on commit 31b980d

Please sign in to comment.