Skip to content

Commit

Permalink
Hotfix sql query due to empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaFox161 committed Dec 1, 2021
1 parent ed12f30 commit 05a9bc2
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -1360,6 +1360,8 @@ object DatabaseManager {
if (!idsToUse.contains(id)) idsToUse.add(id)
}

if (idsToUse.isEmpty()) return Mono.just(emptyMap())

// Convert our list of IDs to sql escaped string
val builder = StringBuilder()
idsToUse.withIndex().forEach {
Expand Down Expand Up @@ -1391,7 +1393,9 @@ object DatabaseManager {
LOGGER.error(DEFAULT, "Failed to get many event data", it)
}.onErrorResume {
Mono.empty()
}.collectMap { it.eventId }
}.collectMap {
it.eventId
}.defaultIfEmpty(emptyMap())
}
}
}
Expand Down

0 comments on commit 05a9bc2

Please sign in to comment.