From 96e4fdf8084db6fddd0a05147bf5350fb4fe7209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sun, 6 Oct 2024 20:48:28 -0700 Subject: [PATCH] fix: avoid panic in `IsRateLimited()` function --- internal/reader/fetcher/response_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/reader/fetcher/response_handler.go b/internal/reader/fetcher/response_handler.go index 2f38b8e4b23..e5d6a5a17e9 100644 --- a/internal/reader/fetcher/response_handler.go +++ b/internal/reader/fetcher/response_handler.go @@ -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 {