From 9c5afa0b8fbbc95548dde8e044bb7d4ae8dcc2c3 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 29 Feb 2024 00:03:06 +0800 Subject: [PATCH] Fix incorrect user location link on profile page (#29474) Fix #29472. Regression of #29236, a "if" check was missing. (cherry picked from commit 10cfa0879a538a470598281d7093de3555c018be) --- routers/web/shared/user/header.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go index c257af46c..fc448fcb4 100644 --- a/routers/web/shared/user/header.go +++ b/routers/web/shared/user/header.go @@ -36,8 +36,9 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) { ctx.Data["IsBlocked"] = ctx.Doer != nil && user_model.IsBlocked(ctx, ctx.Doer.ID, ctx.ContextUser.ID) ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail && ctx.ContextUser.Email != "" && ctx.IsSigned && !ctx.ContextUser.KeepEmailPrivate - ctx.Data["ContextUserLocationMapURL"] = setting.Service.UserLocationMapURL + url.QueryEscape(ctx.ContextUser.Location) - + if setting.Service.UserLocationMapURL != "" { + ctx.Data["ContextUserLocationMapURL"] = setting.Service.UserLocationMapURL + url.QueryEscape(ctx.ContextUser.Location) + } // Show OpenID URIs openIDs, err := user_model.GetUserOpenIDs(ctx, ctx.ContextUser.ID) if err != nil {