diff --git a/app/Console/Commands/ChargeRenewalInvoices.php b/app/Console/Commands/ChargeRenewalInvoices.php index 00d07f8da6ed..1dc6e546f719 100644 --- a/app/Console/Commands/ChargeRenewalInvoices.php +++ b/app/Console/Commands/ChargeRenewalInvoices.php @@ -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;