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
@@ -117,7 +117,7 @@ export async function executePreToolUseHooks(
if (result.stdout) {
try {
const output = JSON.parse(result.stdout) as PreToolUseOutput
const output = JSON.parse(result.stdout || "{}") as PreToolUseOutput
// Handle deprecated decision/reason fields (Claude Code backward compat)
let decision: PermissionDecision | undefined