aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-09 06:37:32 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-09 06:37:32 -0400
commit4ef9494637b71978801156866ba16b67c2e3636f (patch)
tree2b91d825fec00b08c26a45dac53ff06c55b04b67 /routers/repo/issue.go
parent43ffacd05b7b5c9d7b4966f4404a7dc53f2229aa (diff)
Fix panic when view issue without login
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index fc6ee9eb..f2600b9f 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -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.