This commit is contained in:
potassium 2024-12-27 00:31:19 +03:00
parent ddc2c6640f
commit 0912afa68a

View File

@ -98,13 +98,7 @@ func GetImage(link string) (image.Image, error) {
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp == nil {
log.Fatal("pizdec")
}
img, _, err := image.Decode(resp.Body) img, _, err := image.Decode(resp.Body)
if img == nil {
log.Fatal("img is nil")
}
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -123,14 +117,7 @@ buf := new(bytes.Buffer)
takeOne(ShuffledCardPool)))), takeOne(ShuffledCardPool)))),
imageutils.Right, imageutils.Right,
) )
if img == nil { err = png.Encode(buf, img)
log.Fatal("pizdec")
}
err = png.Encode(
buf,
img,
)
if err != nil { if err != nil {
log.Println("error on decode:", err) log.Println("error on decode:", err)
} }