Explicitly check if there are Ids before trying to get items by a list of Ids
This commit is contained in:
parent
3999580fe6
commit
6de3d8b3a1
10 changed files with 61 additions and 18 deletions
|
|
@ -657,6 +657,13 @@ func (n *Namespace) Delete(s *xorm.Session, a web.Auth) (err error) {
|
|||
listIDs = append(listIDs, l.ID)
|
||||
}
|
||||
|
||||
if len(listIDs) == 0 {
|
||||
return events.Dispatch(&NamespaceDeletedEvent{
|
||||
Namespace: n,
|
||||
Doer: a,
|
||||
})
|
||||
}
|
||||
|
||||
// Delete tasks
|
||||
_, err = s.In("list_id", listIDs).Delete(&Task{})
|
||||
if err != nil {
|
||||
|
|
|
|||
Reference in a new issue