Fix crash when updating library whithout manga to update (#6181)

(cherry picked from commit 27542bc81d24e08f077af5996dc354bfefac76f5)
This commit is contained in:
jmir1 2021-10-31 19:25:32 +01:00 committed by Jobobby04
parent be2e95db38
commit c04550fe15

View File

@ -347,7 +347,7 @@ class LibraryUpdateService(
.sortedWith(rankingScheme[selectedScheme])
// Warn when excessively checking a single source
val maxUpdatesFromSource = mangaToUpdate.groupBy { it.source }.maxOf { it.value.size }
val maxUpdatesFromSource = mangaToUpdate.groupBy { it.source }.maxOfOrNull { it.value.size } ?: 0
if (maxUpdatesFromSource > MANGA_PER_SOURCE_QUEUE_WARNING_THRESHOLD) {
toast(R.string.notification_size_warning, Toast.LENGTH_LONG)
}