From aee9f1032c05e3493124d078ac8a4c0acc5778e9 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 28 Jun 2024 02:34:12 +0200 Subject: [PATCH] Exit early in case of empty chapter id list (#980) In case the list was empty, the batch update failed with a NoSuchElement exception --- .../suwayomi/tachidesk/graphql/mutations/ChapterMutation.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/ChapterMutation.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/ChapterMutation.kt index adab0609..5134ff93 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/ChapterMutation.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/ChapterMutation.kt @@ -57,6 +57,10 @@ class ChapterMutation { ids: List, patch: UpdateChapterPatch, ) { + if (ids.isEmpty()) { + return + } + transaction { val chapterIdToPageCount = if (patch.lastPageRead != null) {