Skip to content

Commit

Permalink
fix: avoid panic in IsRateLimited() function
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Oct 7, 2024
1 parent ee8c662 commit 96e4fdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/reader/fetcher/response_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (r *ResponseHandler) ParseRetryDelay() int {
}

func (r *ResponseHandler) IsRateLimited() bool {
return r.httpResponse.StatusCode == http.StatusTooManyRequests
return r.httpResponse != nil && r.httpResponse.StatusCode == http.StatusTooManyRequests
}

func (r *ResponseHandler) IsModified(lastEtagValue, lastModifiedValue string) bool {
Expand Down

0 comments on commit 96e4fdf

Please sign in to comment.