Skip to content

Commit

Permalink
Fix crash with custom config.nzb function
Browse files Browse the repository at this point in the history
Ref #115
  • Loading branch information
animetosho committed Aug 23, 2023
1 parent a4b1712 commit d0d4c0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nzb.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function NZBGenerator(meta, writeFunc, packed, encoding) {
newline = indent = '';

this._write = writeFunc;
this.encoding = encoding;
this.encoding = encoding || 'utf8';

var data = '';

Expand All @@ -44,7 +44,7 @@ function NZBGenerator(meta, writeFunc, packed, encoding) {
data += indent + '</head>' + newline;
}

var xmlEncoding = encoding.toUpperCase();
var xmlEncoding = this.encoding.toUpperCase();
if(xmlEncoding in XmlEncodingMap)
xmlEncoding = XmlEncodingMap[xmlEncoding];
var bom = xmlEncoding == 'UTF-16' ? '\uFEFF' : '';
Expand Down

0 comments on commit d0d4c0c

Please sign in to comment.