Don't try to get albums if ids is empty

This commit is contained in:
Deluan 2020-01-22 01:03:49 -05:00
parent 2bca711f72
commit c73f549c83
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,9 @@ func (r *albumRepository) GetAll(options ...model.QueryOptions) (model.Albums, e
func (r *albumRepository) GetMap(ids []string) (map[string]model.Album, error) {
var all []album
if len(ids) == 0 {
return nil, nil
}
_, err := r.newQuery().Filter("id__in", ids).All(&all)
if err != nil {
return nil, err