1
0

fix(filters): only insert task buckets and positions when there are any

This commit is contained in:
kolaente 2024-07-18 15:38:29 +02:00
parent 03381f47bf
commit bea81f83f7
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -257,13 +257,15 @@ func (sf *SavedFilter) Update(s *xorm.Session, _ web.Auth) error {
}
}
_, err = s.Insert(taskBuckets)
if err != nil {
return err
}
_, err = s.Insert(taskPositions)
if err != nil {
return err
if len(taskBuckets) > 0 && len(taskPositions) > 0 {
_, err = s.Insert(taskBuckets)
if err != nil {
return err
}
_, err = s.Insert(taskPositions)
if err != nil {
return err
}
}
return nil