Skip to content

Commit f2cb4fd

Browse files
authored
Fix customer.subscription.deleted crash when workspace has no owner (dubinc#3856)
1 parent 63826c2 commit f2cb4fd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ export async function customerSubscriptionDeleted(
253253
}
254254

255255
const owner = workspaceUsers[0];
256-
if (owner.email && losesAdvancedFeatures) {
256+
257+
if (owner?.email && losesAdvancedFeatures) {
257258
await sendEmail({
258259
to: owner.email,
259260
subject: "Your Advanced plan features have been removed",

0 commit comments

Comments
 (0)