From ddc2c6640f5162497f7eb28bffe6fcfa6fa07e9c Mon Sep 17 00:00:00 2001 From: potassium5703 Date: Fri, 27 Dec 2024 00:26:46 +0300 Subject: [PATCH] fixed a huge mistake --- market.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/market.go b/market.go index f58f7f7..3d7fccb 100644 --- a/market.go +++ b/market.go @@ -98,6 +98,9 @@ func GetImage(link string) (image.Image, error) { } defer resp.Body.Close() +if resp == nil { + log.Fatal("pizdec") +} img, _, err := image.Decode(resp.Body) if img == nil { log.Fatal("img is nil") @@ -112,7 +115,7 @@ func HandleCommand(update tg.Update, bot *tg.BotAPI) { maxCost := 5 var err error for i := 0; i <= maxCost; i++ { - var buf *bytes.Buffer +buf := new(bytes.Buffer) var img = imageutils.Concat( Must(GetImage(fmt.Sprintf(LinkFormat, takeOne(ShuffledCardPool)))),