From c73f549c83c14265f758c0336fd15c5bb51bd602 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 22 Jan 2020 01:03:49 -0500 Subject: [PATCH] Don't try to get albums if ids is empty --- persistence/album_repository.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/persistence/album_repository.go b/persistence/album_repository.go index 712e414fb..513ae3bb3 100644 --- a/persistence/album_repository.go +++ b/persistence/album_repository.go @@ -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