cli: fix missing safety check in ShowIAM (#2165)

* Add missing safety check to ShowIAM

* someErr->assert.AnError

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-08-09 15:25:59 +02:00 committed by GitHub
parent c9cae643e2
commit 23394ea2e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 218 additions and 22 deletions

View file

@ -87,6 +87,9 @@ func (c *Client) ShowIAM(ctx context.Context, provider cloudprovider.Provider) (
if err != nil {
return IAMOutput{}, err
}
if tfState == nil || tfState.Values == nil {
return IAMOutput{}, errors.New("terraform show: no values returned")
}
switch provider {
case cloudprovider.GCP: