Skip to content

Commit

Permalink
IsUserAllowedToUpdate should igonre if user is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Mar 4, 2021
1 parent 8ac1367 commit 8918c0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/pull/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8918c0f

Please sign in to comment.