Skip to content

Commit

Permalink
fix: handle case where there is no appId (#8049)
Browse files Browse the repository at this point in the history
This was causing E2E test failures.

Refs: #7874

Co-authored-by: Colin Ihrig <[email protected]>
  • Loading branch information
cjihrig and cjihrig-aws authored Aug 26, 2021
1 parent 04b29f2 commit f7e62df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/amplify-cli/src/utils/check-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import { getPluginInstance } from '../extensions/amplify-helpers/get-plugin-inst

export async function hasCdBranches(context) {
const appId = context.exeInfo.amplifyMeta.providers.awscloudformation.AmplifyAppId;

if (!appId) {
return false;
}

const awsCloudPlugin = getPluginInstance(context, 'awscloudformation');
const amplifyClient = await awsCloudPlugin.getConfiguredAmplifyClient(context, {});
const result = await amplifyClient.listBranches({ appId }).promise();
Expand Down

0 comments on commit f7e62df

Please sign in to comment.