From d2e561ebba49db4681a7dc5adb2dcfbc56d37257 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Wed, 7 Feb 2024 15:38:55 -0700 Subject: [PATCH] fix: bug with no alias check (#74) --- pkg/awsutil/account.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/awsutil/account.go b/pkg/awsutil/account.go index adf37f10..321ba562 100644 --- a/pkg/awsutil/account.go +++ b/pkg/awsutil/account.go @@ -1,6 +1,7 @@ package awsutil import ( + "fmt" "strings" "github.com/pkg/errors" @@ -76,6 +77,10 @@ func (a *Account) ID() string { } func (a *Account) Alias() string { + if len(a.aliases) == 0 { + return fmt.Sprintf("no-alias-%s", a.ID()) + } + return a.aliases[0] }