From 1105ee7ab0a1ad1d34012a94e408184642eb141b Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 10 Dec 2024 15:32:22 +0000 Subject: [PATCH] Fix psalm --- src/MTProtoSession/ResponseHandler.php | 1 + 1 file changed, 1 insertion(+) 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);