From 120d07d889e736b871bf79a2a29d86bc3242c2e8 Mon Sep 17 00:00:00 2001 From: ssw Date: Wed, 17 Jun 2026 12:54:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(jnpf-browser-automation):=20guard=20USER=5F?= =?UTF-8?q?END=5FMAP=20=E7=BC=BA=E6=9D=A1=E7=9B=AE=20=E2=80=94=20clear=20e?= =?UTF-8?q?rror=20msg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code review I-1: prevent silent KeyError when adding 11th control. Co-Authored-By: Claude --- skills/jnpf-browser-automation/scripts/build_controls.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skills/jnpf-browser-automation/scripts/build_controls.py b/skills/jnpf-browser-automation/scripts/build_controls.py index 0fc0d2f..30ec387 100644 --- a/skills/jnpf-browser-automation/scripts/build_controls.py +++ b/skills/jnpf-browser-automation/scripts/build_controls.py @@ -62,6 +62,8 @@ USER_END_MAP = { def build_controls() -> dict: controls = [] for jnpfKey, label, fieldName, fieldLabel, fillValue, configSchema in CONTROLS_DEF: + if jnpfKey not in USER_END_MAP: + raise SystemExit(f"✗ USER_END_MAP 缺条目: {jnpfKey}") ue = {**USER_END_MAP[jnpfKey], "fillValue": fillValue} controls.append({ "jnpfKey": jnpfKey,