diff --git a/src/TgBotLib/PollingBot.php b/src/TgBotLib/PollingBot.php index 27b3e63..e9c0f28 100644 --- a/src/TgBotLib/PollingBot.php +++ b/src/TgBotLib/PollingBot.php @@ -234,7 +234,7 @@ foreach ($updates as $update) { // Check if the update contains a command - $command = $update->getAnyMessage()->getCommand(); + $command = $update?->getAnyMessage()?->getCommand(); if ($command !== null) { $commandHandlers = $this->getEventHandlersByCommand($command);