From 21ebabdde348b2bcc32369e092f435c77fc9d42e Mon Sep 17 00:00:00 2001 From: orangix Date: Tue, 15 Aug 2023 21:53:01 +0200 Subject: [PATCH] fix panic --- api/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/user.go b/api/user.go index b7d39a7..0107f10 100644 --- a/api/user.go +++ b/api/user.go @@ -173,7 +173,7 @@ func parseSubmission(value gjson.Result) Submission { Url: strings.ReplaceAll(c.Get("url").String(), "https://i.imgur.com", ""), } // Replace with thumbnails here because it's easier. - if cover.Url[len(cover.Url)-3:] == "mp4" { + if strings.HasSuffix(cover.Url, ".mp4") { cover.Url = cover.Url[:len(cover.Url)-3] + "webp" } default: