Skip to content

Commit

Permalink
fix: Ensure email content fields are not null by providing default va…
Browse files Browse the repository at this point in the history
…lues
  • Loading branch information
beilunyang committed Dec 28, 2024
1 parent 6e55ba3 commit 9bcb18e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions workers/email-receiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ const handleEmail = async (message: ForwardableEmailMessage, env: Env) => {
}

const savedMessage = await db.insert(messages).values({
// @ts-expect-error "ignore"
emailId: targetEmail.id,
fromAddress: message.from,
subject: parsedMessage.subject,
content: parsedMessage.text,
html: parsedMessage.html || null,
subject: parsedMessage.subject || '(无主题)',
content: parsedMessage.text || '',
html: parsedMessage.html || '',
}).returning().get()

const webhook = await db.query.webhooks.findFirst({
Expand Down

0 comments on commit 9bcb18e

Please sign in to comment.