aboutsummaryrefslogtreecommitdiffstats
path: root/services/pull/merge.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-14 18:29:31 +0200
committerGitHub <noreply@github.com>2020-04-14 19:29:31 +0300
commitf7ecc2bee7eb62ad6bac2697ce5acc6a1767e415 (patch)
tree8a2b48eeaba227c8781e685d1e0733a4afbe3395 /services/pull/merge.go
parent10e2f291442fdc7efc31c02f5ffcba79a36db9ac (diff)
downloadgitea-f7ecc2bee7eb62ad6bac2697ce5acc6a1767e415.tar.gz
gitea-f7ecc2bee7eb62ad6bac2697ce5acc6a1767e415.zip
fix (#11066)
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 {