summaryrefslogtreecommitdiffstats
path: root/modules/context/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r--modules/context/repo.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 9e37ae3fbf..895640a823 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -219,7 +219,11 @@ func RepoAssignment(args ...bool) macaron.Handler {
if ctx.IsSigned && ctx.User.IsAdmin {
ctx.Repo.AccessMode = models.AccessModeOwner
} else {
- mode, err := models.AccessLevel(ctx.User.ID, repo)
+ var userID int64
+ if ctx.User != nil {
+ userID = ctx.User.ID
+ }
+ mode, err := models.AccessLevel(userID, repo)
if err != nil {
ctx.Handle(500, "AccessLevel", err)
return