Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix `customer.subscription.deleted` crash when workspace has no owner (#3856)

Kiran Kf2cb4fd45a3d
diff --git a/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts b/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts
index 02fc6b61d6..7e9bec81d9 100644
--- a/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts
+++ b/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts
@@ -253,7 +253,8 @@ export async function customerSubscriptionDeleted(
}
const owner = workspaceUsers[0];
- if (owner.email && losesAdvancedFeatures) {
+
+ if (owner?.email && losesAdvancedFeatures) {
await sendEmail({
to: owner.email,
subject: "Your Advanced plan features have been removed",