From 70622343315f6755987d8cb56fb1b2302d07ce90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Epif=C3=A2nio?= <26820396+tfve@users.noreply.github.com> Date: Sun, 10 May 2020 23:21:56 +0100 Subject: [PATCH] Avoid creating invalid url when the user doesn't have an avatar (matrix) (#1130) --- bridge/matrix/matrix.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 824870cf..78779c87 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -372,6 +372,8 @@ func (b *Bmatrix) getAvatarURL(sender string) string { return "" } url := strings.ReplaceAll(mxcURL, "mxc://", b.GetString("Server")+"/_matrix/media/r0/thumbnail/") - url += "?width=37&height=37&method=crop" + if url != "" { + url += "?width=37&height=37&method=crop" + } return url }