Browse Source

Check that array is not empty

proxy_request
Rodrigo Gonzalez 2 years ago
parent
commit
1b118cc2cf
  1. 4
      src/model/NotificationPayload.php

4
src/model/NotificationPayload.php

@ -86,7 +86,9 @@ class NotificationPayload
} }
$instance->latestExpiredReceipt = $request->input('unified_receipt.latest_expired_receipt'); $instance->latestExpiredReceipt = $request->input('unified_receipt.latest_expired_receipt');
if ($request->has('unified_receipt.latest_expired_receipt_info')) { if ($request->has('unified_receipt.latest_expired_receipt_info')) {
$instance->latestExpiredReceiptInfo = Receipt::createFromArray($request->input('unified_receipt.latest_expired_receipt_info')[0]); if (count($request->input('unified_receipt.latest_expired_receipt_info')) > 0) {
$instance->latestExpiredReceiptInfo = Receipt::createFromArray($request->input('unified_receipt.latest_expired_receipt_info')[0]);
}
} else { } else {
$instance->latestExpiredReceiptInfo = null; $instance->latestExpiredReceiptInfo = null;
} }

Loading…
Cancel
Save