fix: add missing error check

This commit is contained in:
kolaente 2022-07-07 23:23:15 +02:00
parent 2b074c60a7
commit 5cc4927b9e
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -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)
}