Check if baltop offset is not negative

This commit is contained in:
SKBotNL committed 2026-07-29 12:24:05 +02:00
1 parent 5c3e8f0e5d
commit 85723e3f50
1 file changed
+4 -1
@@ -176,7 +176,10 @@ internal class CachingBalanceManager private constructor() : BalanceManager {
}
}
override suspend fun getBaltop(offset: Int): Result<Map<UUID?, Long>> = postgreSQL.getBaltop(offset)
override suspend fun getBaltop(offset: Int): Result<Map<UUID?, Long>> {
require(offset >= 0) { "offset must not be negative" }
return postgreSQL.getBaltop(offset)
}
override suspend fun getBaltopWithUuid(uuid: UUID): Result<Pair<Map<UUID?, Long>, Long>> =
postgreSQL.getBaltopWithUuid(uuid)