Browse Source

IsUserAllowedToUpdate should igonre if user is nil (#14886)

tags/v1.13.4
6543 3 years ago
parent
commit
8a6acbbc12
No account linked to committer's email address
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      services/pull/update.go

+ 3
- 0
services/pull/update.go View File

@@ -48,6 +48,9 @@ func Update(pull *models.PullRequest, doer *models.User, message string) error {

// IsUserAllowedToUpdate check if user is allowed to update PR with given permissions and branch protections
func IsUserAllowedToUpdate(pull *models.PullRequest, user *models.User) (bool, error) {
if user == nil {
return false, nil
}
headRepoPerm, err := models.GetUserRepoPermission(pull.HeadRepo, user)
if err != nil {
return false, err

Loading…
Cancel
Save