Skip to content

Commit

Permalink
Titus: fix aws account lookup to return null if account is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaslin committed Mar 26, 2018
1 parent e51e218 commit 585c62d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ class AwsLookupUtil {
}

String awsAccountId(account, region) {
Map awsDetails = lookupAccount(account, region)
if (!awsDetails) {
return null
}
accountCredentialsProvider.all.find {
it instanceof AmazonCredentials && it.name == lookupAccount(account, region).awsAccount
it instanceof AmazonCredentials && it.name == awsDetails.awsAccount
}?.accountId
}

Expand Down

0 comments on commit 585c62d

Please sign in to comment.