Skip to content

Commit

Permalink
fix packet ID check
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgreenthal committed Oct 18, 2023
1 parent 76e6f2a commit 259ddb6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class PacketAssignmentService {

val packetIds = assignments.map { it.packetId!! }
val packets = packetRepo.findByIdIn(packetIds)
require(packets.size == packetIds.size) { "Invalid packet IDs" }
require(packets.size == packetIds.distinct().size) { "Invalid packet IDs" }
require(packets.all { it.availableForCompetition == true }) { "Packets not available for competition" }
val packetsById: Map<Long, Packet> = packets.associateBy { it.id!! }

Expand Down

0 comments on commit 259ddb6

Please sign in to comment.