istg
Anirudh Oppiliappan x@icyphox.sh
Sat, 12 Aug 2023 12:03:13 +0300
1 files changed,
20 insertions(+),
16 deletions(-)
jump to
M
web.go
→
web.go
@@ -2340,25 +2340,29 @@ n := r.FormValue("a")
if isurl(n) { uinfo := login.GetUserInfo(r) - j, err := GetJunkFast(uinfo.UserID, n) - if err != nil { - dlog.Println("avatating: getting junk:", err) - a = avatateautogen(r) - } - pfpurl, _ := j.GetString("icon", "url") - res, err := http.Get(pfpurl) - if err != nil { - dlog.Println("avatating: getting pfp url:", err) - a = avatateautogen(r) - } else { - defer res.Body.Close() - - pfpbytes, err := io.ReadAll(res.Body) + if uinfo != nil { + j, err := GetJunkFast(uinfo.UserID, n) if err != nil { - dlog.Println("avatating: bruh shits clapped:", err) + dlog.Println("avatating: getting junk:", err) a = avatateautogen(r) } - a = pfpbytes + pfpurl, _ := j.GetString("icon", "url") + res, err := http.Get(pfpurl) + if err != nil { + dlog.Println("avatating: getting pfp url:", err) + a = avatateautogen(r) + } else { + defer res.Body.Close() + + pfpbytes, err := io.ReadAll(res.Body) + if err != nil { + dlog.Println("avatating: bruh shits clapped:", err) + a = avatateautogen(r) + } + a = pfpbytes + } + } else { + a = avatateautogen(r) } } else { a = avatateautogen(r)