Skip to content

Commit 73b4777

Browse files
committed
fix subscription.deleted crash when workspace has no human owner
1 parent 9075d37 commit 73b4777

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)