mirror of https://github.com/go-gitea/gitea.git
Backport #19625 CheckRepoUnitUser should tolerate nil users. Fix #19613 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
46637b1164
commit
18dd49a4ab
|
@ -132,7 +132,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 {
|
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
|
return true
|
||||||
}
|
}
|
||||||
perm, err := getUserRepoPermission(ctx, repo, user)
|
perm, err := getUserRepoPermission(ctx, repo, user)
|
||||||
|
|
Loading…
Reference in New Issue