From bae551520ae52ef4e046c16a29e5bf8e0ff2de25 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 8 Feb 2025 16:31:15 +0300 Subject: [PATCH] handle missing images directory --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7ba5fc4..321ab6e 100644 --- a/main.go +++ b/main.go @@ -66,7 +66,12 @@ func getImages() []string { if err != nil { logger.WithError(err).Fatal("Error reading images directory") } - var images []string + + if len(files) == 0 { + logger.Warn("No images found in the images directory") + } + + var images []string for _, file := range files { images = append(images, file.Name()) logger.Info("Loaded image:", file.Name())