mirror of
https://github.com/TwiN/gatus.git
synced 2025-01-24 14:58:41 +01:00
Fix potential panic
This commit is contained in:
parent
5433653cbb
commit
be72a73082
@ -169,7 +169,7 @@ func (service *Service) call(result *Result) {
|
|||||||
result.Errors = append(result.Errors, err.Error())
|
result.Errors = append(result.Errors, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if response.TLS != nil {
|
if response.TLS != nil && len(response.TLS.PeerCertificates) > 0 {
|
||||||
certificate := response.TLS.PeerCertificates[0]
|
certificate := response.TLS.PeerCertificates[0]
|
||||||
result.CertificateExpiration = certificate.NotAfter.Sub(time.Now())
|
result.CertificateExpiration = certificate.NotAfter.Sub(time.Now())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user