Check that org listpolicy isn't nil.

Fix a panic in our test that is caused by a ListPolicy being nil. I
assume, but cannot verify, that this is an API change in that it may now
send back a nil listpolicy if a default is used.
This commit is contained in:
Paddy Carver 2018-04-30 16:15:27 -07:00
parent e58e099b1a
commit 1a169a5900

View File

@ -169,6 +169,10 @@ func testAccCheckGoogleProjectOrganizationListPolicyAll(n, policyType string) re
return err
}
if policy.ListPolicy == nil {
return nil
}
if len(policy.ListPolicy.AllowedValues) > 0 || len(policy.ListPolicy.DeniedValues) > 0 {
return fmt.Errorf("The `values` field shouldn't be set")
}