Skip to content

Commit

Permalink
Set context early on in LoadAndValidate to prevent NPE (#3800) (#488)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jul 31, 2020
1 parent 3904ae5 commit 748e331
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ func (c *Config) LoadAndValidate(ctx context.Context) error {
c.Scopes = DefaultClientScopes
}

c.context = ctx

tokenSource, err := c.getTokenSource(c.Scopes)
if err != nil {
return err
Expand Down Expand Up @@ -315,7 +317,6 @@ func (c *Config) LoadAndValidate(ctx context.Context) error {
userAgent := fmt.Sprintf("%s %s", tfUserAgent, providerVersion)

c.client = client
c.context = ctx
c.userAgent = userAgent

// This base path and some others below need the version and possibly more of the path
Expand Down

0 comments on commit 748e331

Please sign in to comment.