Skip to content

Commit 5e091ec

Browse files
committed
Prevent IndexOutOfBoundsException when removing duplicated chapters
In case the "new" chapters consisted only of re-uploads an out of bound exception was thrown
1 parent fbf726c commit 5e091ec

File tree

1 file changed

+1
-1
lines changed
  • server/src/main/kotlin/suwayomi/tachidesk/manga/impl

1 file changed

+1
-1
lines changed

server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ object Chapter {
370370
val actualNewChapters = newChapters.subtract(reUploadedChapters.toSet()).toList()
371371
val chaptersToConsiderForDownloadLimit =
372372
if (serverConfig.autoDownloadIgnoreReUploads.value) {
373-
actualNewChapters.removeDuplicates(actualNewChapters[0])
373+
if (actualNewChapters.isNotEmpty()) actualNewChapters.removeDuplicates(actualNewChapters[0]) else emptyList()
374374
} else {
375375
newChapters.removeDuplicates(newChapters[0])
376376
}.sortedBy { it.index }

0 commit comments

Comments
 (0)