Skip to content

Commit 10cfa08

Browse files
authored
Fix incorrect user location link on profile page (#29474)
Fix #29472. Regression of #29236, a "if" check was missing.
1 parent 1ad4bb9 commit 10cfa08

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

routers/web/shared/user/header.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
3535
prepareContextForCommonProfile(ctx)
3636

3737
ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail && ctx.ContextUser.Email != "" && ctx.IsSigned && !ctx.ContextUser.KeepEmailPrivate
38-
ctx.Data["ContextUserLocationMapURL"] = setting.Service.UserLocationMapURL + url.QueryEscape(ctx.ContextUser.Location)
39-
38+
if setting.Service.UserLocationMapURL != "" {
39+
ctx.Data["ContextUserLocationMapURL"] = setting.Service.UserLocationMapURL + url.QueryEscape(ctx.ContextUser.Location)
40+
}
4041
// Show OpenID URIs
4142
openIDs, err := user_model.GetUserOpenIDs(ctx, ctx.ContextUser.ID)
4243
if err != nil {

0 commit comments

Comments
 (0)