diff --git a/lib/screens/scan_tab.dart b/lib/screens/scan_tab.dart index df7d0f1..a77b0e4 100644 --- a/lib/screens/scan_tab.dart +++ b/lib/screens/scan_tab.dart @@ -150,8 +150,10 @@ class ScanTabState extends State { .toList(), onChanged: (id) { setState(() { - _selectedCollection = _collections - .firstWhere((c) => c.id == id); + final matching = + _collections.where((c) => c.id == id); + _selectedCollection = + matching.isNotEmpty ? matching.first : null; }); }, ),