Skip to content

Commit

Permalink
fix: add missing error check
Browse files Browse the repository at this point in the history
  • Loading branch information
kolaente committed Jul 7, 2022
1 parent 2b074c6 commit 5cc4927
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/models/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
package models

import (
"github.com/jinzhu/copier"
"math"
"regexp"
"sort"
"strconv"
"strings"
"time"

"github.com/jinzhu/copier"

"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/events"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 5cc4927

Please sign in to comment.