Skip to content

Commit

Permalink
fix: handle nil pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Oct 16, 2024
1 parent 0798a01 commit 5ac7971
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion connection/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ func (t *AWSConnection) Populate(ctx ConnectionContext) error {
if t.ConnectionName != "" {
connection, err := ctx.HydrateConnectionByURL(t.ConnectionName)
if err != nil {
return fmt.Errorf("could not parse EC2 access key: %v", err)
return fmt.Errorf("could not parse EC2 access key: %w", err)
}
if connection == nil {
return fmt.Errorf("connection[%s] not found", t.ConnectionName)
}

t.AccessKey.ValueStatic = connection.Username
Expand Down

0 comments on commit 5ac7971

Please sign in to comment.