Skip to content

Commit a0c443d

Browse files
code-asherkylecarbs
authored andcommitted
Sometimes an exec has no callback
How lonely.
1 parent 20f5d8e commit a0c443d

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

packages/protocol/src/browser/modules/child_process.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ export class CP {
3232
if (typeof options === "function") {
3333
callback = options;
3434
}
35-
// @ts-ignore not sure how to make this work.
36-
callback(
37-
error,
38-
useBuffer(options) ? Buffer.from(stdout) : stdout,
39-
useBuffer(options) ? Buffer.from(stderr) : stderr,
40-
);
35+
if (callback) {
36+
// @ts-ignore not sure how to make this work.
37+
callback(
38+
error,
39+
useBuffer(options) ? Buffer.from(stdout) : stdout,
40+
useBuffer(options) ? Buffer.from(stderr) : stderr,
41+
);
42+
}
4143
});
4244

4345
// @ts-ignore TODO: not fully implemented

0 commit comments

Comments
 (0)