Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit 39a5296

Browse files
committed
fix(base): Add check for null stout and stderr on output to console
1 parent 2a670b8 commit 39a5296

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib/base.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ export class Base {
6666
const stderrWords = child.stderr ? _.words(child.stderr.toString()).filter((word: string) => word) : [];
6767
if (child.status === 1 || child.status === '1' || stderrWords.length > 0) {
6868
this.log('commandRunner').error('status', child.status);
69-
this.log('commandRunner').error('stderr', child.stderr.toString());
70-
this.log('commandRunner').debug('stdout', child.stdout.toString());
69+
this.log('commandRunner').error('stderr', child.stderr?child.stderr.toString():child.stderr);
70+
this.log('commandRunner').debug('stdout', child.stdout?child.stdout.toString():child.stdout);
7171
this.log('commandRunner').debug('end');
7272
}
7373
else {
7474
this.log('commandRunner').debug('status', child.status);
75-
this.log('commandRunner').debug('stderr', child.stderr.toString());
76-
this.log('commandRunner').debug('stdout', child.stdout.toString());
75+
this.log('commandRunner').debug('stderr', child.stderr?child.stderr.toString():child.stderr);
76+
this.log('commandRunner').debug('stdout', child.stdout?child.stdout.toString():child.stdout);
7777
this.log('commandRunner').debug('end');
7878
}
7979
return await child.status === 0;

0 commit comments

Comments
 (0)