From 14aaaaa7de4eacd6d91232f82400f89aed5988bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 16:01:54 +0000 Subject: [PATCH] Fix boundary condition for MAX_SUBJECT_COUNT check Co-authored-by: bdehamer <398027+bdehamer@users.noreply.github.com> --- src/subject.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/subject.ts b/src/subject.ts index 5bd5901..256a783 100644 --- a/src/subject.ts +++ b/src/subject.ts @@ -99,12 +99,12 @@ const getSubjectFromPath = async ( for (const p of paths) { const stat = await fs.stat(p) if (stat.isFile()) { - files.push(p) - if (files.length > MAX_SUBJECT_COUNT) { + if (files.length >= MAX_SUBJECT_COUNT) { throw new Error( - `Too many subjects specified (${files.length}). The maximum number of subjects is ${MAX_SUBJECT_COUNT}.` + `Too many subjects specified (at least ${files.length + 1}). The maximum number of subjects is ${MAX_SUBJECT_COUNT}.` ) } + files.push(p) } }