Skip to content

Commit d68a7f6

Browse files
committed
Fix panic in go-gitea#7611
Use pr.IssueID instead of pr.Issue.ID as Issue may not be loaded and is unnecessary
1 parent 734aa96 commit d68a7f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/branches.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (protectBranch *ProtectedBranch) HasEnoughApprovals(pr *PullRequest) bool {
101101

102102
// GetGrantedApprovalsCount returns the number of granted approvals for pr. A granted approval must be authored by a user in an approval whitelist.
103103
func (protectBranch *ProtectedBranch) GetGrantedApprovalsCount(pr *PullRequest) int64 {
104-
reviews, err := GetReviewersByPullID(pr.Issue.ID)
104+
reviews, err := GetReviewersByPullID(pr.IssueID)
105105
if err != nil {
106106
log.Error("GetReviewersByPullID: %v", err)
107107
return 0

0 commit comments

Comments
 (0)