mirror of
https://github.com/go-gitea/gitea.git
synced 2024-08-25 21:44:20 -04:00
Fix panic when view issue without login
This commit is contained in:
parent
43ffacd05b
commit
4ef9494637
@ -254,10 +254,12 @@ func ViewIssue(ctx *middleware.Context, params martini.Params) {
|
||||
}
|
||||
}
|
||||
|
||||
// Update issue-user.
|
||||
if err = models.UpdateIssueUserPairByRead(ctx.User.Id, issue.Id); err != nil {
|
||||
ctx.Handle(500, "issue.ViewIssue(UpdateIssueUserPairByRead): %v", err)
|
||||
return
|
||||
if ctx.IsSigned {
|
||||
// Update issue-user.
|
||||
if err = models.UpdateIssueUserPairByRead(ctx.User.Id, issue.Id); err != nil {
|
||||
ctx.Handle(500, "issue.ViewIssue(UpdateIssueUserPairByRead): %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Get poster and Assignee.
|
||||
|
Loading…
Reference in New Issue
Block a user