Skip to content

Commit

Permalink
🐛 fix tls.certificates is not properly initialized (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuskimmina authored Nov 2, 2023
1 parent 9fb5820 commit 4995683
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions providers/network/resources/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 4995683

Please sign in to comment.