From 653449659a3dec46a824f077a791f35c2f0db687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Dugovi=C4=8D?= Date: Thu, 7 Mar 2024 16:44:42 +0100 Subject: [PATCH] RHINENG-7099: fix evaluator-recalc nil pointer dereference --- base/utils/http.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/utils/http.go b/base/utils/http.go index db3f84807..0c98e0a32 100644 --- a/base/utils/http.go +++ b/base/utils/http.go @@ -37,7 +37,9 @@ func HTTPCallRetry(ctx context.Context, httpCallFun func() (outputDataPtr interf } responseDetails := tryGetResponseDetails(resp) - resp.Body.Close() + if resp != nil { + resp.Body.Close() + } return nil, errors.Wrap(callErr, "HTTP call failed"+responseDetails) } return nil, errors.Errorf("HTTP retry call failed, attempts: %d", attempt)