Avoid creating invalid url when the user doesn't have an avatar (matrix) (#1130)

This commit is contained in:
Tiago Epifânio 2020-05-10 23:21:56 +01:00 committed by GitHub
parent 9754569525
commit 7062234331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -372,6 +372,8 @@ func (b *Bmatrix) getAvatarURL(sender string) string {
return "" return ""
} }
url := strings.ReplaceAll(mxcURL, "mxc://", b.GetString("Server")+"/_matrix/media/r0/thumbnail/") url := strings.ReplaceAll(mxcURL, "mxc://", b.GetString("Server")+"/_matrix/media/r0/thumbnail/")
if url != "" {
url += "?width=37&height=37&method=crop" url += "?width=37&height=37&method=crop"
}
return url return url
} }