Skip to content

Commit

Permalink
Prevent [email] tag from crashing on missing attachments.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Nov 17, 2010
1 parent 3660fed commit 4f1c94c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/UserTag/email.tag
Expand Up @@ -196,6 +196,7 @@ sub {
$msg->attach(
Type => $ref->{type},
Path => $ref->{path},
ReadNow => 1,
Data => $ref->{data},
Filename => $ref->{filename},
Encoding => $ref->{encoding},
Expand All @@ -204,7 +205,9 @@ sub {
};
if($@) {
::logError("email tag: failed to attach %s: %s", $ref->{path}, $@);
next;
$Tag->error({name => 'email',
set => errmsg('Failed to attach %s', $ref->{path})});
return;
}
}

Expand Down

0 comments on commit 4f1c94c

Please sign in to comment.