Skip to content

Commit 187c21e

Browse files
committed
fix(desktop): harden diagnostics export safety
1 parent c2c14c1 commit 187c21e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

apps/desktop/main/diagnostics-export.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ function runCommand(
255255
timeout: 5000,
256256
});
257257

258-
const stdout = result.stdout.trim();
259-
const stderr = result.stderr.trim();
258+
const stdout = result.stdout?.trim() ?? "";
259+
const stderr = result.stderr?.trim() ?? "";
260260

261261
return {
262262
binaryPath,
@@ -614,12 +614,16 @@ async function collectArtifacts(
614614
}
615615

616616
if (desktopDiagnosticsSummary) {
617-
entries.push({
618-
name: `${archiveRoot}/summary/startup-probe-summary.json`,
619-
data: Buffer.from(
617+
const redactedStartupProbeSummary = redactJsonBuffer(
618+
Buffer.from(
620619
`${JSON.stringify(desktopDiagnosticsSummary, null, 2)}\n`,
621620
"utf8",
622621
),
622+
);
623+
624+
entries.push({
625+
name: `${archiveRoot}/summary/startup-probe-summary.json`,
626+
data: redactedStartupProbeSummary,
623627
modTime: now,
624628
});
625629
included.push("summary/startup-probe-summary.json");

0 commit comments

Comments
 (0)