Skip to content

Commit

Permalink
Handle edge-case that text_body or html_body could be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kalys committed Oct 12, 2024
1 parent 04af0bc commit 7418893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bamboo/adapters/render/raw.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ defmodule BambooSes.Render.Raw do
alias BambooSes.Encoding

def render(email, extra_headers \\ []) do
has_text = String.length(email.text_body) > 0
has_html = String.length(email.html_body) > 0
has_text = !is_nil(email.text_body) && String.length(email.text_body) > 0
has_html = !is_nil(email.html_body) && String.length(email.html_body) > 0
has_attachments = length(filter_regular_attachments(email)) > 0
has_inline_attachments = length(filter_inline_attachments(email)) > 0

Expand Down

0 comments on commit 7418893

Please sign in to comment.