From 0e3b18cd5bf24c289f7e90a9b4f6c16ee066dead Mon Sep 17 00:00:00 2001 From: Codex-Kuikly-KMP Date: Mon, 7 Sep 2026 17:12:15 +0800 Subject: [PATCH] fix(worker): guard unchecked index on first AGC test group Signed-off-by: Codex-Kuikly-KMP --- worker/src/routes/agc_testing.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worker/src/routes/agc_testing.ts b/worker/src/routes/agc_testing.ts index f7b40f32..78659a37 100644 --- a/worker/src/routes/agc_testing.ts +++ b/worker/src/routes/agc_testing.ts @@ -196,8 +196,9 @@ export async function handleSubmitAgcInvitationTest(c: AdminContext) { let effectiveGroupIds = requestedGroupIds; if (effectiveGroupIds.length === 0) { const groups = await listAgcTestGroups(agcAuth, sub.external_app_id); - if (groups.length > 0) { - effectiveGroupIds = [groups[0].groupId]; + const firstGroup = groups[0]; + if (firstGroup?.groupId) { + effectiveGroupIds = [firstGroup.groupId]; } } if (effectiveGroupIds.length === 0) {