From 89d0165fb6b515b6612268b96512f91bd042221b Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 21:18:44 -0400 Subject: [PATCH] Updated GiveawayCompleted --- src/TgBotLib/Objects/GiveawayCompleted.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TgBotLib/Objects/GiveawayCompleted.php b/src/TgBotLib/Objects/GiveawayCompleted.php index 65cb593..922ff6c 100644 --- a/src/TgBotLib/Objects/GiveawayCompleted.php +++ b/src/TgBotLib/Objects/GiveawayCompleted.php @@ -67,8 +67,13 @@ class GiveawayCompleted implements ObjectTypeInterface /** * @inheritDoc */ - public static function fromArray(array $data): ObjectTypeInterface + public static function fromArray(?array $data): ?GiveawayCompleted { + if($data === null) + { + return null; + } + $object = new self(); $object->winner_count = $data['winner_count']; $object->unclaimed_prize_count = $data['unclaimed_prize_count'] ?? null;