Fixed null value

This commit is contained in:
Daan Geurts 2019-10-24 15:18:09 +02:00
parent d2843835a6
commit 3444ad06ba

View File

@ -51,9 +51,13 @@ class NotificationPayload
$instance->autoRenewStatusChangeDate = $request->input('auto_renew_status_change_date'); $instance->autoRenewStatusChangeDate = $request->input('auto_renew_status_change_date');
$instance->autoRenewStatusChangeDatePst = $request->input('auto_renew_status_change_date_pst'); $instance->autoRenewStatusChangeDatePst = $request->input('auto_renew_status_change_date_pst');
$instance->autoRenewStatusChangeDateMs = $request->input('auto_renew_status_change_date_ms'); $instance->autoRenewStatusChangeDateMs = $request->input('auto_renew_status_change_date_ms');
if ($request->has('pending_renewal_info')) {
foreach ($request->input('pending_renewal_info') as $pendingRenewalInfo) { foreach ($request->input('pending_renewal_info') as $pendingRenewalInfo) {
$instance->pendingRenewalInfo[] = RenewalInfo::createFromRequest($pendingRenewalInfo); $instance->pendingRenewalInfo[] = RenewalInfo::createFromRequest($pendingRenewalInfo);
} }
} else {
$instance->pendingRenewalInfo = null;
}
return $instance; return $instance;
} }