From 0358edf6b6caf12fc48810d7a6790a1d220404d6 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Wed, 28 Feb 2024 14:34:19 +0100 Subject: [PATCH] Fix no favicon data --- .../provider/favicon_loader.provider.dart | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/screens/bookmarks/provider/favicon_loader.provider.dart b/lib/screens/bookmarks/provider/favicon_loader.provider.dart index f966203..9b28348 100644 --- a/lib/screens/bookmarks/provider/favicon_loader.provider.dart +++ b/lib/screens/bookmarks/provider/favicon_loader.provider.dart @@ -62,13 +62,20 @@ class FaviconStore extends _$FaviconStore { notExist, ); - final faviconUrls = favicons.asMap().entries.map( - (e) => FaviconItem( - url: notExist[e.key], - favicon: e.value!.url, - isSvg: e.value!.url.contains('svg'), - ), - ); + final faviconUrls = favicons + .asMap() + .entries + .map( + (e) => e.value != null + ? FaviconItem( + url: notExist[e.key], + favicon: e.value!.url, + isSvg: e.value!.url.contains('svg'), + ) + : null, + ) + .where((e) => e != null) + .toList() as List; state.favicons = [...state.favicons, ...faviconUrls]; state.loadingFavicons = false;