fix crash in pfp code attempt yksi
Anirudh Oppiliappan x@icyphox.sh
Thu, 22 Jun 2023 12:19:10 +0300
1 files changed,
8 insertions(+),
7 deletions(-)
jump to
M
web.go
→
web.go
@@ -2333,15 +2333,16 @@ res, err := http.Get(pfpurl)
if err != nil { dlog.Println("avatating: getting pfp url:", err) a = avatateautogen(r) - } - defer res.Body.Close() + } else { + defer res.Body.Close() - pfpbytes, err := io.ReadAll(res.Body) - if err != nil { - dlog.Println("avatating: bruh shits clapped:", err) - a = avatateautogen(r) + pfpbytes, err := io.ReadAll(res.Body) + if err != nil { + dlog.Println("avatating: bruh shits clapped:", err) + a = avatateautogen(r) + } + a = pfpbytes } - a = pfpbytes } else { a = avatateautogen(r) }