summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index e934b24fb3..fbc766850d 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -54,7 +54,7 @@ func CheckRepoUnitUser(repo *repo_model.Repository, user *user_model.User, unitT
}
func checkRepoUnitUser(ctx context.Context, repo *repo_model.Repository, user *user_model.User, unitType unit.Type) bool {
- if user.IsAdmin {
+ if user != nil && user.IsAdmin {
return true
}
perm, err := GetUserRepoPermission(ctx, repo, user)