From 94e0ab436b47e085323bf414e6cb6f30fab1cec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=BCllner?= <79001016+derkauzigekoala@users.noreply.github.com> Date: Tue, 24 Feb 2026 20:14:48 +0100 Subject: [PATCH] Update lib/screens/scan_tab.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lib/screens/scan_tab.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }); }, ),