Fix LoadProjects function

pull/34386/head
Tyrone Yeh 2025-05-26 09:04:53 +08:00
parent 57957ecb64
commit 0b78ae4161
No known key found for this signature in database
GPG Key ID: AC8B5AA00375E170
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ import (
// LoadProject load the project the issue was assigned to
func (issue *Issue) LoadProjects(ctx context.Context) (err error) {
if len(issue.Projects) == 0 {
if issue.Projects == nil {
err = db.GetEngine(ctx).Table("project").
Join("INNER", "project_issue", "project.id=project_issue.project_id").
Where("project_issue.issue_id = ?", issue.ID).Find(&issue.Projects)