From c09c4e5b20b0c5be4e8a7b612035cec00fa247b4 Mon Sep 17 00:00:00 2001 From: Vilen Topchii <32271530+vtopc@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:17:31 +0300 Subject: [PATCH] fix nil pointer dereference --- messages.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/messages.go b/messages.go index 5df22aff..efe0e7d2 100644 --- a/messages.go +++ b/messages.go @@ -914,6 +914,9 @@ func (mg *MailgunImpl) GetStoredAttachment(ctx context.Context, url string) ([]b r.addHeader("Accept", "message/rfc2822") response, err := makeGetRequest(ctx, r) + if err != nil { + return nil, err + } return response.Data, err }