mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-04 08:09:33 +08:00
Add check for arguments of NetworkHandlerSupport.sendAndExpect
This commit is contained in:
parent
9ceb7c3fc2
commit
84fb928764
@ -88,6 +88,7 @@ internal abstract class NetworkHandlerSupport(
|
||||
}
|
||||
|
||||
final override suspend fun sendAndExpect(packet: OutgoingPacket, timeout: Long, attempts: Int): Packet? {
|
||||
require(attempts >= 1) { "attempts must be at least 1." }
|
||||
val listener = PacketListener(packet.commandName, packet.sequenceId)
|
||||
withExceptionCollector {
|
||||
repeat(attempts) {
|
||||
|
Loading…
Reference in New Issue
Block a user