summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Model/WriteMails.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/JWebmail/Model/WriteMails.pm')
-rw-r--r--lib/JWebmail/Model/WriteMails.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/JWebmail/Model/WriteMails.pm b/lib/JWebmail/Model/WriteMails.pm
index 7a50bcb..f4d09e8 100644
--- a/lib/JWebmail/Model/WriteMails.pm
+++ b/lib/JWebmail/Model/WriteMails.pm
@@ -24,13 +24,13 @@ sub _build_mail {
},
body_str => $mail->{message},
);
- my $attach = Email::MIME->create(
+ my $attach = $mail->{attach} ? Email::MIME->create(
attributes => {
content_type => $mail->{attach_type},
encoding => 'base64',
},
body => $mail->{attach}->asset->slurp,
- ) if $mail->{attach};
+ ) : undef;
my $email = Email::MIME->create(
header_str => [