Skip to content

Commit 2004c17

Browse files
committed
fix(cloud9): filter out invalid elements
1 parent c9195bd commit 2004c17

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/cloud9/data.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ const errorLog = new AwsErrorLog(serviceName)
2828
const endpoint = initTestEndpoint(serviceName)
2929
const MAX_ITEMS = 25
3030

31-
const listEnvironmentsForRegion = async ({
32-
cloud9,
31+
const listEnvironmentsForRegion = async ({
32+
cloud9,
3333
resolveRegion,
3434
}: {
3535
cloud9: Cloud9
@@ -150,7 +150,7 @@ export default async ({
150150
[region: string]: RawAwsCloud9Environment[]
151151
}> =>
152152
new Promise(async resolve => {
153-
const cloud9Data: RawAwsCloud9Environment[] = []
153+
let cloud9Data: RawAwsCloud9Environment[] = []
154154
const environmentPromises = []
155155
const regionPromises = []
156156
const tagsPromises = []
@@ -208,6 +208,8 @@ export default async ({
208208
logger.debug(lt.gettingCloud9Environments)
209209
await Promise.all(environmentPromises)
210210

211+
// remove environments that don't have an arn (failed to get attributes)
212+
cloud9Data = cloud9Data.filter(({ arn }) => !!arn)
211213
// get all tags for each environment
212214
cloud9Data.map(({ arn, region }, idx) => {
213215
const cloud9 = new Cloud9({ ...config, region, endpoint })

0 commit comments

Comments
 (0)