fix: add missing error check
This commit is contained in:
parent
2b074c60a7
commit
5cc4927b9e
1 changed files with 7 additions and 2 deletions
|
@ -17,7 +17,6 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/copier"
|
||||
"math"
|
||||
"regexp"
|
||||
"sort"
|
||||
|
@ -25,6 +24,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
"code.vikunja.io/api/pkg/events"
|
||||
|
@ -681,7 +682,11 @@ func addRelatedTasksToTasks(s *xorm.Session, taskIDs []int64, taskMap map[int64]
|
|||
// We're duplicating the other task to avoid cycles as these can't be represented properly in json
|
||||
// and would thus fail with an error.
|
||||
otherTask := &Task{}
|
||||
copier.Copy(otherTask, fullRelatedTasks[rt.OtherTaskID])
|
||||
err = copier.Copy(otherTask, fullRelatedTasks[rt.OtherTaskID])
|
||||
if err != nil {
|
||||
log.Errorf("Could not duplicate task object: %v", err)
|
||||
continue
|
||||
}
|
||||
otherTask.RelatedTasks = nil
|
||||
taskMap[rt.TaskID].RelatedTasks[rt.RelationKind] = append(taskMap[rt.TaskID].RelatedTasks[rt.RelationKind], otherTask)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue