From 20cd2aeacfd9adc9565cb971509b47395f3f9418 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 15:20:14 -0400 Subject: [PATCH] Updated RefundedPayment --- src/TgBotLib/Objects/Payments/RefundedPayment.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Objects/Payments/RefundedPayment.php b/src/TgBotLib/Objects/Payments/RefundedPayment.php index 7736ee3..590b0b6 100644 --- a/src/TgBotLib/Objects/Payments/RefundedPayment.php +++ b/src/TgBotLib/Objects/Payments/RefundedPayment.php @@ -81,10 +81,14 @@ class RefundedPayment implements ObjectTypeInterface /** * @inheritDoc */ - public static function fromArray(array $data): ObjectTypeInterface + public static function fromArray(?array $data): ?RefundedPayment { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->currency = $data['currency']; $object->total_amount = $data['total_amount']; $object->invoice_payload = $data['invoice_payload'];