Only invoke callback once in case of an error

This commit is contained in:
Patrick Steele-Idem 2014-11-06 13:32:44 -07:00
parent 8706e582ed
commit adc46efc65

View File

@ -82,7 +82,7 @@ Template.prototype = {
callback(null, out.getOutput());
});
out.on('error', callback);
out.once('error', callback);
} else if (!out || !out.isAsyncWriter) {
var stream = out;
// Assume the "out" is really a stream