Skip to content

Commit

Permalink
Fix panic in go when reading invalid env property
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyeh committed Jan 6, 2025
1 parent b312d33 commit b7f4244
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/go/api_esc_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func (c *EscClient) OpenAndReadEnvironmentAtVersion(ctx context.Context, org, pr
// The property is returned along with the resolved value.
func (c *EscClient) ReadEnvironmentProperty(ctx context.Context, org, projectName, envName, openEnvID, propPath string) (*Value, any, error) {
prop, _, err := c.EscAPI.ReadOpenEnvironmentProperty(ctx, org, projectName, envName, openEnvID).Property(propPath).Execute()
if prop == nil {
return nil, nil, err
}

v := mapValuesPrimitive(prop.Value)
return prop, v, err
}
Expand Down

0 comments on commit b7f4244

Please sign in to comment.