mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Check ctx.Written()
for GetActionIssue
(#25698)
Fix #25697. Just avoid panic, maybe there's another bug to trigger this case. --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
c0edb9b78b
commit
3c05aa4927
5 changed files with 20 additions and 11 deletions
|
@ -1977,7 +1977,7 @@ func GetActionIssue(ctx *context.Context) *issues_model.Issue {
|
|||
return nil
|
||||
}
|
||||
if err = issue.LoadAttributes(ctx); err != nil {
|
||||
ctx.ServerError("LoadAttributes", nil)
|
||||
ctx.ServerError("LoadAttributes", err)
|
||||
return nil
|
||||
}
|
||||
return issue
|
||||
|
@ -3282,6 +3282,9 @@ func filterXRefComments(ctx *context.Context, issue *issues_model.Issue) error {
|
|||
// GetIssueAttachments returns attachments for the issue
|
||||
func GetIssueAttachments(ctx *context.Context) {
|
||||
issue := GetActionIssue(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
attachments := make([]*api.Attachment, len(issue.Attachments))
|
||||
for i := 0; i < len(issue.Attachments); i++ {
|
||||
attachments[i] = convert.ToAttachment(issue.Attachments[i])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue