Skip to content

Commit 914b9a8

Browse files
fix(qa-lab): guard stream listeners against possibly-null child stdio
The attachGatewayChildStreamErrorHandlers helper called `child.stdout.on("error", ...)` directly, but `node:child_process` types `child.stdout` as `Readable | null`. PR-head check-prod-types, check-test-types, and check-additional-extension-package-boundary all failed with TS18047 ('child.stdout' is possibly 'null'). Add the existing `?.` chain so the listener only attaches when the pipe is present; this matches the production stdio shape used at the spawn site (`["ignore", "pipe", "pipe"]`, which guarantees the pipes exist at runtime). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 148f3fd commit 914b9a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/qa-lab/src/gateway-child.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ function attachGatewayChildStreamErrorHandlers(
416416
child.kill("SIGTERM");
417417
}
418418
};
419-
child.stdout.on("error", handleStreamError("stdout"));
420-
child.stderr.on("error", handleStreamError("stderr"));
419+
child.stdout?.on("error", handleStreamError("stdout"));
420+
child.stderr?.on("error", handleStreamError("stderr"));
421421
}
422422

423423
function monitorQaGatewayChildSpawnError(

0 commit comments

Comments
 (0)