fix(hooks): add defensive null check for matcher.hooks to prevent Windows crash (#441)

This commit is contained in:
YeonGyu-Kim
2026-02-07 13:12:18 +09:00
parent 306da83431
commit 2e0f6bcdf8
7 changed files with 39 additions and 34 deletions
+5 -4
View File
@@ -47,11 +47,12 @@ export async function executePreCompactHooks(
let firstHookName: string | undefined
const collectedContext: string[] = []
for (const matcher of matchers) {
for (const hook of matcher.hooks) {
if (hook.type !== "command") continue
for (const matcher of matchers) {
if (!matcher.hooks || matcher.hooks.length === 0) continue
for (const hook of matcher.hooks) {
if (hook.type !== "command") continue
if (isHookCommandDisabled("PreCompact", hook.command, extendedConfig ?? null)) {
if (isHookCommandDisabled("PreCompact", hook.command, extendedConfig ?? null)) {
log("PreCompact hook command skipped (disabled by config)", { command: hook.command })
continue
}