Added check if the namespace exists when creating a list

This commit is contained in:
kolaente 2018-07-26 10:49:33 +02:00
parent 6eeab7fe10
commit c97a4d74cb
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,12 @@ func CreateOrUpdateList(list *List) (err error) {
return ErrListTitleCannotBeEmpty{}
}
// Check if the namespace exists
_, err = GetNamespaceByID(list.NamespaceID)
if err != nil {
return err
}
if list.ID == 0 {
_, err = x.Insert(list)
} else {