From 388aafc046edf1e17df7609d9ae922804401ab54 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Wed, 8 Feb 2023 12:49:57 -0600 Subject: [PATCH] fix: load issue before accessing index Signed-off-by: jolheiser --- services/pull/merge.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/pull/merge.go b/services/pull/merge.go index edd5b601da934..a3d69df8df048 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -98,6 +98,9 @@ func GetDefaultMergeMessage(ctx context.Context, baseGitRepo *git.Repository, pr } for _, ref := range refs { if ref.RefAction == references.XRefActionCloses { + if err := ref.LoadIssue(ctx); err != nil { + return "", "", err + } closeIssueIndexes = append(closeIssueIndexes, fmt.Sprintf("%s %s%d", closeWord, issueReference, ref.Issue.Index)) } }