From 6280b8c0264716800d56c8bd0a5791067ff14e26 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 21:19:51 -0400 Subject: [PATCH] Updated GiveawayWinners --- src/TgBotLib/Objects/GiveawayWinners.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Objects/GiveawayWinners.php b/src/TgBotLib/Objects/GiveawayWinners.php index 9d15fa6..0ec4810 100644 --- a/src/TgBotLib/Objects/GiveawayWinners.php +++ b/src/TgBotLib/Objects/GiveawayWinners.php @@ -166,10 +166,14 @@ class GiveawayWinners implements ObjectTypeInterface /** * @inheritDoc */ - public static function fromArray(array $data): ObjectTypeInterface + public static function fromArray(?array $data): ?GiveawayWinners { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->chat = Chat::fromArray($data['chat']); $object->giveaway_message_id = $data['giveaway_message_id']; $object->winners_selection_date = $data['winners_selection_date'];