IsUserAllowedToUpdate ignore igonre if user is nil (#14885)

tokarchuk/v1.17
6543 4 years ago committed by GitHub
parent 8ac1367718
commit 11229ca539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      services/pull/update.go

@ -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