Skip to content

Commit 8a6acbb

Browse files
authored
IsUserAllowedToUpdate should igonre if user is nil (#14886)
1 parent 98b3d8d commit 8a6acbb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/pull/update.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func Update(pull *models.PullRequest, doer *models.User, message string) error {
4848

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

0 commit comments

Comments
 (0)