Skip to content

Commit fa4bf24

Browse files
committed
check empty ip address resp
1 parent 128bdd6 commit fa4bf24

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ func (h *Client) updateIPAddr() error {
106106
if res.StatusCode() != http.StatusOK {
107107
return errors.New(body)
108108
}
109+
if body == "" {
110+
return errors.New("couldn't get IP address")
111+
}
109112
if body == h.ipAddr {
110113
return nil
111114
}

0 commit comments

Comments
 (0)