Skip to content

Commit 466b365

Browse files
committed
fix(spawnify) _set setEncoding when child is null
1 parent deb09d9 commit 466b365

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/spawnify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@
128128
break;
129129
}
130130

131-
child.stderr.setEncoding('utf-8');
132-
child.stdout.setEncoding('utf-8');
133-
child.stdin.setEncoding('utf-8');
134-
135131
if (error) {
136132
this._emit('error', newLine(error));
137133
} else {
134+
child.stderr.setEncoding('utf-8');
135+
child.stdout.setEncoding('utf-8');
136+
child.stdin.setEncoding('utf-8');
137+
138138
this._setListeners(child);
139139

140140
this.on('kill', function(code) {

0 commit comments

Comments
 (0)