fix: guard unsafe .first/.last calls to prevent StateError

This commit is contained in:
edde746
2026-03-10 03:50:12 +01:00
parent 42e066288f
commit 73fe9e054f
7 changed files with 25 additions and 16 deletions
+2 -2
View File
@@ -145,7 +145,7 @@ class OfflineWatchProvider extends ChangeNotifier {
}
// All episodes watched - return first episode for replay
return episodes.first;
return episodes.firstOrNull;
}
/// Find the next unwatched downloaded episode synchronously.
@@ -164,7 +164,7 @@ class OfflineWatchProvider extends ChangeNotifier {
}
// All episodes watched - return first episode for replay
return episodes.first;
return episodes.firstOrNull;
}
/// Emit a watch state change event for immediate UI update.