From e8c7759250cf7a7eb1fc0047a4cef27cd75ab15b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 4 Jun 2020 00:05:13 +0530 Subject: fixes empty list issues --- lib/data/favorites.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/data') diff --git a/lib/data/favorites.dart b/lib/data/favorites.dart index 2e389b8..45f1e00 100644 --- a/lib/data/favorites.dart +++ b/lib/data/favorites.dart @@ -8,7 +8,7 @@ const String SEPERATOR = ','; StreamController> favorites_$ = StreamController>.broadcast(); Future getApplication(String pkg) async { - if (pkg.length == 0) return null; + if (pkg == null || pkg.length == 0) return null; try { return DeviceApps.getApp(pkg); } catch(e) { @@ -49,7 +49,7 @@ void setFavorites(List favs) async { } void addToFavorites(Application app) async { - List fs = await getFavorites(); + List fs = await getFavorites() as List; var matching = fs.where((a) => a.packageName == app.packageName); if(matching.length == 0) { -- cgit v1.3.1