summaryrefslogtreecommitdiffstats
path: root/services/pull/merge.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/pull/merge.go')
-rw-r--r--services/pull/merge.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 2d4d9722e8..a20a214014 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -535,6 +535,9 @@ func IsSignedIfRequired(pr *models.PullRequest, doer *models.User) (bool, error)
// IsUserAllowedToMerge check if user is allowed to merge PR with given permissions and branch protections
func IsUserAllowedToMerge(pr *models.PullRequest, p models.Permission, user *models.User) (bool, error) {
+ if user == nil {
+ return false, nil
+ }
err := pr.LoadProtectedBranch()
if err != nil {