Skip to content

Commit

Permalink
Default the decode function if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
baudehlo committed Aug 22, 2012
1 parent 01c257c commit b28fae2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mailbody.js
Expand Up @@ -94,6 +94,10 @@ Body.prototype.parse_start = function (line) {
enc = enc.toLowerCase().split("\n").pop().trim();

this.decode_function = this["decode_" + enc];
if (!this.decode_function) {
logger.logerror("No decode function found for: " + enc);
this.decode_function = this.decode_8bit;
}
this.ct = ct;

if (/^(?:text|message)\//i.test(ct) && !/^attachment/i.test(cd) ) {
Expand Down

0 comments on commit b28fae2

Please sign in to comment.