From 09679250090ee467f2606650d8ebc587039a2359 Mon Sep 17 00:00:00 2001 From: A Ghoul Coder Date: Sun, 4 Jun 2023 09:56:18 +0300 Subject: [PATCH] Check length of icons to avoid runtime error when using icons[0] later. --- pkg/image/favicon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/image/favicon.go b/pkg/image/favicon.go index 8c123fefb..499d544b1 100644 --- a/pkg/image/favicon.go +++ b/pkg/image/favicon.go @@ -73,7 +73,7 @@ func downloadIcon(ctx context.Context, iconPath string, siteURL string) { } icons, err := favicon.Find(u.Scheme + "://" + u.Host) - if err != nil { + if err != nil || len(icons) < 1 { return }