diff --git a/providers/network/resources/tls.go b/providers/network/resources/tls.go index a49eff41e0..df4f3f41d4 100644 --- a/providers/network/resources/tls.go +++ b/providers/network/resources/tls.go @@ -318,14 +318,20 @@ func (s *mqlTls) certificates(params interface{}) ([]interface{}, error) { // We leverage the fact that params has to be created first, and that params // causes this field to be set. If it isn't, then we cannot determine it. // (TODO: use the recording data to do this async) - s.Certificates.State = plugin.StateIsSet | plugin.StateIsNull - return nil, nil + if len(s.Certificates.Data) == 0 { + s.Certificates.State = plugin.StateIsSet | plugin.StateIsNull + return nil, nil + } + return s.Certificates.Data, nil } func (s *mqlTls) nonSniCertificates(params interface{}) ([]interface{}, error) { // We leverage the fact that params has to be created first, and that params // causes this field to be set. If it isn't, then we cannot determine it. // (TODO: use the recording data to do this async) - s.NonSniCertificates.State = plugin.StateIsSet | plugin.StateIsNull - return nil, nil + if len(s.NonSniCertificates.Data) == 0 { + s.NonSniCertificates.State = plugin.StateIsSet | plugin.StateIsNull + return nil, nil + } + return s.NonSniCertificates.Data, nil }