meme: add missing error check

This commit is contained in:
Chris Sexton 2020-10-23 10:07:02 -04:00 committed by Chris Sexton
parent ac3d037fa4
commit fed1951e66
1 changed files with 3 additions and 1 deletions

View File

@ -346,7 +346,9 @@ func (p *MemePlugin) genMeme(meme string, bully image.Image, config []memeText)
u, err := url.Parse(imgName)
if err != nil || u.Scheme == "" {
log.Debug().Err(err).Str("imgName", imgName).Msgf("url not detected")
u, _ = url.Parse("https://imgflip.com/s/meme/" + imgName)
if u, err = url.Parse("https://imgflip.com/s/meme/" + imgName); err != nil {
return "", 0, 0, err
}
}
log.Debug().Msgf("Attempting to download url: %s", u.String())