diff --git a/app/Http/Controllers/Webhook/Stripe.php b/app/Http/Controllers/Webhook/Stripe.php index 87b18c009..200d3dd1c 100644 --- a/app/Http/Controllers/Webhook/Stripe.php +++ b/app/Http/Controllers/Webhook/Stripe.php @@ -170,9 +170,11 @@ public function events(Request $request) $quantity = data_get($data, 'items.data.0.quantity', 10); } $team = data_get($subscription, 'team'); - $team->update([ - 'custom_server_limit' => $quantity, - ]); + if ($team) { + $team->update([ + 'custom_server_limit' => $quantity, + ]); + } ServerLimitCheckJob::dispatch($team); } $subscription->update([ @@ -214,7 +216,9 @@ public function events(Request $request) $customerId = data_get($data, 'customer'); $subscription = Subscription::where('stripe_customer_id', $customerId)->firstOrFail(); $team = data_get($subscription, 'team'); - $team->trialEnded(); + if ($team) { + $team->trialEnded(); + } $subscription->update([ 'stripe_subscription_id' => null, 'stripe_plan_id' => null,