Skip to content

Commit c487985

Browse files
6543Yohann Delafollye
authored andcommitted
1 parent 7c9bf3e commit c487985

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/pull/merge.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ func IsSignedIfRequired(pr *models.PullRequest, doer *models.User) (bool, error)
535535

536536
// IsUserAllowedToMerge check if user is allowed to merge PR with given permissions and branch protections
537537
func IsUserAllowedToMerge(pr *models.PullRequest, p models.Permission, user *models.User) (bool, error) {
538+
if user == nil {
539+
return false, nil
540+
}
538541

539542
err := pr.LoadProtectedBranch()
540543
if err != nil {

0 commit comments

Comments
 (0)