Handle deleted account when charging renewals

This commit is contained in:
Hillel Coren 2016-07-20 22:53:54 +03:00
parent 8bc3d6c937
commit fa18feb8e5

View File

@ -70,8 +70,11 @@ class ChargeRenewalInvoices extends Command
foreach ($invoices as $invoice) {
// check if account has switched to free since the invoice was created
// check if account has switched to free since the invoice was created
$account = Account::find($invoice->client->public_id);
if ( ! $account) {
continue;
}
$company = $account->company;
if ( ! $company->plan || $company->plan == PLAN_FREE) {
continue;