From 926ab06c51d6d865a1ef148e7cb6bcf9ffedddc9 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 21:14:41 -0400 Subject: [PATCH] Minor Correction --- src/TgBotLib/Objects/ForumTopicCreated.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Objects/ForumTopicCreated.php b/src/TgBotLib/Objects/ForumTopicCreated.php index 54d857e..b99afaf 100644 --- a/src/TgBotLib/Objects/ForumTopicCreated.php +++ b/src/TgBotLib/Objects/ForumTopicCreated.php @@ -56,10 +56,14 @@ /** * @inheritDoc */ - public static function fromArray(?array $data): ForumTopicCreated + public static function fromArray(?array $data): ?ForumTopicCreated { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->name = $data['name'] ?? null; $object->icon_color = $data['icon_color'] ?? null; $object->icon_custom_emoji_id = $data['icon_custom_emoji_id'] ?? null;