Fix getting task attachments and related tasks if none are available
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
f210e915b8
commit
1635beda56
|
@ -209,6 +209,10 @@ func getTaskAttachmentsByTaskIDs(s *xorm.Session, taskIDs []int64) (attachments
|
|||
return
|
||||
}
|
||||
|
||||
if len(attachments) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
fileIDs := []int64{}
|
||||
userIDs := []int64{}
|
||||
for _, a := range attachments {
|
||||
|
|
|
@ -597,6 +597,11 @@ func addRelatedTasksToTasks(s *xorm.Session, taskIDs []int64, taskMap map[int64]
|
|||
for _, rt := range relatedTasks {
|
||||
relatedTaskIDs = append(relatedTaskIDs, rt.OtherTaskID)
|
||||
}
|
||||
|
||||
if len(relatedTaskIDs) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
fullRelatedTasks := make(map[int64]*Task)
|
||||
err = s.In("id", relatedTaskIDs).Find(&fullRelatedTasks)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue