diff --git a/src/TgBotLib/Objects/ForceReply.php b/src/TgBotLib/Objects/ForceReply.php index 0e9a755..c205bd2 100644 --- a/src/TgBotLib/Objects/ForceReply.php +++ b/src/TgBotLib/Objects/ForceReply.php @@ -60,8 +60,12 @@ */ public static function fromArray(?array $data): ?ForceReply { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->force_reply = $data['force_reply'] ?? false; $object->inline_field_placeholder = $data['inline_field_placeholder'] ?? null; $object->selective = $data['selective'] ?? false;