Lint: Handle URL parser error for stream previews

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-08-06 14:42:23 +02:00
parent 9f164c43d3
commit 4fc3c692c4
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -235,6 +235,10 @@ func (m modLivePosting) sendLivePost(username, displayName, title, game, preview
"{height}", strconv.Itoa(livePostingPreviewHeight), "{height}", strconv.Itoa(livePostingPreviewHeight),
).Replace(previewImage), ).Replace(previewImage),
) )
if err != nil {
return errors.Wrap(err, "parsing stream preview URL")
}
previewImageQuery := previewImageURL.Query() previewImageQuery := previewImageURL.Query()
previewImageQuery.Add("_discordNoCache", time.Now().Format(time.RFC3339)) previewImageQuery.Add("_discordNoCache", time.Now().Format(time.RFC3339))
previewImageURL.RawQuery = previewImageQuery.Encode() previewImageURL.RawQuery = previewImageQuery.Encode()