fix: guard JSON.parse(result.stdout) with || "{}" fallback in hook handlers (#1191)

Co-authored-by: wangxiaoya.2000 <wangxiaoya.2000@bytedance.com>
This commit is contained in:
Xiaoya Wang
2026-01-28 15:26:28 +08:00
committed by GitHub
parent 5558ddf468
commit d11c4a1f81
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ export async function executeStopHooks(
if (result.stdout) {
try {
const output = JSON.parse(result.stdout) as StopOutput
const output = JSON.parse(result.stdout || "{}") as StopOutput
if (output.stop_hook_active !== undefined) {
stopHookActiveState.set(ctx.sessionId, output.stop_hook_active)
}