diff --git a/src/MTProtoSession/ResponseHandler.php b/src/MTProtoSession/ResponseHandler.php index ea2f14a6a..a1c7580b1 100644 --- a/src/MTProtoSession/ResponseHandler.php +++ b/src/MTProtoSession/ResponseHandler.php @@ -454,6 +454,7 @@ trait ResponseHandler return static fn () => RPCErrorException::make($response['error_message'], $response['error_code'], $request->constructor); case 420: $seconds = (int) preg_replace('/[^0-9]+/', '', $response['error_message']); + \assert($seconds > 0); $limit = $request->floodWaitLimit ?? $this->API->settings->getRPC()->getFloodTimeout(); if ($seconds < $limit) { $this->API->logger("Flood, waiting $seconds seconds before repeating async call of $request...", Logger::NOTICE);