Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
prevent nil pointer exception when pilosa cluster does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
travisturner committed Oct 16, 2019
1 parent 0c53860 commit f252c0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,11 @@ func (c *Client) doRequest(host *URI, method, path string, headers map[string]st
if tries == 0 {
break
}
c.logger.Printf("request failed with: %v status: %d, retrying after %d more time(s) after %v ", err, resp.StatusCode, tries, sleepTime)
var statusCode int
if resp != nil {
statusCode = resp.StatusCode
}
c.logger.Printf("request failed with: %v status: %d, retrying after %d more time(s) after %v ", err, statusCode, tries, sleepTime)
time.Sleep(sleepTime)
sleepTime *= 2
if sleepTime > c.maxRetrySleepTime {
Expand Down

0 comments on commit f252c0d

Please sign in to comment.