From 27542bc81d24e08f077af5996dc354bfefac76f5 Mon Sep 17 00:00:00 2001 From: jmir1 <43830312+jmir1@users.noreply.github.com> Date: Sun, 31 Oct 2021 19:25:32 +0100 Subject: [PATCH] Fix crash when updating library whithout manga to update (#6181) --- .../eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt index 19b7a40b1b..8937082ccf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt @@ -268,7 +268,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) }