From a0c443d8d3df397411eb3deb9cdaa6c409fb3df4 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 30 Jan 2019 10:26:24 -0600 Subject: [PATCH] Sometimes an exec has no callback How lonely. --- .../protocol/src/browser/modules/child_process.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/protocol/src/browser/modules/child_process.ts b/packages/protocol/src/browser/modules/child_process.ts index b64688af..182895f7 100644 --- a/packages/protocol/src/browser/modules/child_process.ts +++ b/packages/protocol/src/browser/modules/child_process.ts @@ -32,12 +32,14 @@ export class CP { if (typeof options === "function") { callback = options; } - // @ts-ignore not sure how to make this work. - callback( - error, - useBuffer(options) ? Buffer.from(stdout) : stdout, - useBuffer(options) ? Buffer.from(stderr) : stderr, - ); + if (callback) { + // @ts-ignore not sure how to make this work. + callback( + error, + useBuffer(options) ? Buffer.from(stdout) : stdout, + useBuffer(options) ? Buffer.from(stderr) : stderr, + ); + } }); // @ts-ignore TODO: not fully implemented