diff --git a/app/api/debug-email/route.ts b/app/api/debug-email/route.ts index 41dde05..8c75e36 100644 --- a/app/api/debug-email/route.ts +++ b/app/api/debug-email/route.ts @@ -42,6 +42,9 @@ export async function GET(request: Request) { if (!source) { return NextResponse.json({ error: 'Email source not available' }, { status: 404 }); } + if (!envelope) { + return NextResponse.json({ error: 'Email envelope not available' }, { status: 404 }); + } const rawSource = source.toString(); // Parse the email with multiple options to debug