aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-02-29 00:03:06 +0800
committerGitHub <noreply@github.com>2024-02-28 16:03:06 +0000
commit10cfa0879a538a470598281d7093de3555c018be (patch)
tree146602817ba3ca203a1beb6878a7dd4a010583f6
parent1ad4bb9eb7641a552c5b88a43eb91d59ec5c0edf (diff)
downloadgitea-10cfa0879a538a470598281d7093de3555c018be.tar.gz
gitea-10cfa0879a538a470598281d7093de3555c018be.zip
Fix incorrect user location link on profile page (#29474)
Fix #29472. Regression of #29236, a "if" check was missing.
-rw-r--r--routers/web/shared/user/header.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go
index eb108268ae..2253b8840d 100644
--- a/routers/web/shared/user/header.go
+++ b/routers/web/shared/user/header.go
@@ -35,8 +35,9 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
prepareContextForCommonProfile(ctx)
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 {