@cryptotaxi247 / netdata-1 / commits / 264c607f7

go.d whoisquery: check if exp date is empty (#17911)

Ilya Mashchenko committed Jun 16, 2024 at 18:36 UTC 264c607f7a37d6022dd4d4ef5ab1b2903ac68f1b
1 file changed +5
src/go/collectors/go.d.plugin/modules/whoisquery/provider.go
+5
@@ -3,6 +3,7 @@
3 package whoisquery
4
5 import (
6 + "errors"
7 "strings"
8 "time"
9
@@ -49,6 +50,10 @@ func (f *fromNet) remainingTime() (float64, error) {
50 }
51 }
52
53 + if result.Domain.ExpirationDate == "" {
54 + return 0, errors.New("no expiration date")
55 + }
56 +
57 expire, err := dateparse.ParseAny(result.Domain.ExpirationDate)
58 if err != nil {
59 return 0, err