From d4764ce4850f928cae50b253eb250a99feecc436 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 4 Sep 2022 22:45:30 +0200 Subject: [PATCH] Avoid infinite loop when no picture to load --- backend_local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend_local.go b/backend_local.go index ade2f86..55aa353 100644 --- a/backend_local.go +++ b/backend_local.go @@ -71,7 +71,7 @@ func (l *LocalFileBackend) ListPictures(box string) ([]*Picture, error) { return nil, err } - var pictures []*Picture + pictures := make([]*Picture, 0) for _, file := range files { if !file.IsDir() { pictures = append(pictures, l.createPictureInfo(path.Join(box, file.Name()), file.Name(), file))