From 08919814d361aa11083ed7a5c3169d449e744d10 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Fri, 26 Jun 2020 10:45:42 +0800 Subject: [PATCH] fix(api): collection without element would return incorrect dto --- .../org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt index 25402acd..2420e995 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt @@ -92,7 +92,7 @@ class SeriesCollectionDao( private fun ResultQuery.fetchAndMap() = fetchGroups({ it.into(c) }, { it.into(cs) }) .map { (cr, csr) -> - val seriesIds = csr.map { it.seriesId } + val seriesIds = csr.mapNotNull { it.seriesId } cr.toDomain(seriesIds) }