From 47adf765d59f307e4d58fa834402080f79c6d861 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 18 Jan 2023 12:18:27 +0100 Subject: [PATCH] Fix 500 error viewing pull request when fork has pull requests disabled Fixes #20826 --- services/pull/update.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/pull/update.go b/services/pull/update.go index 9e29f63c7c857..e78fd71564374 100644 --- a/services/pull/update.go +++ b/services/pull/update.go @@ -117,6 +117,9 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest, return false, false, err } prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests) + if repo_model.IsErrUnitTypeNotExist(err) { + return false, false, nil + } if err != nil { log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err) return false, false, err