From bf32a76f4904222b8458be0ea7fadd8f91fd7acc Mon Sep 17 00:00:00 2001 From: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Date: Thu, 4 Dec 2025 20:43:31 +0530 Subject: [PATCH] fix(frontend): prevent NodeHandle error when array schema items is undefined (#11549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added conditional rendering in `NodeArrayInput` component to only render `NodeHandle` when `schema.items` is defined - This prevents the error when array schemas don't have an `items` property defined - The input field rendering logic already had proper null checks, so only the handle rendering needed to be fixed ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Open the legacy builder and create a new agent - [x] Add a Smart Decision block to the agent - [x] Verify that the `conversation_history` field renders without errors - [x] Verify that array fields with defined `items` still render correctly (e.g., test with other blocks that use arrays) - [x] Verify that connecting/disconnecting handles to the conversation_history field works correctly - [x] Verify that the field can accept input values when not connected --- .../components/legacy-builder/NodeInputs.tsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx index e26718b18d..683a854c21 100644 --- a/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx @@ -981,15 +981,17 @@ const NodeArrayInput: FC<{ ); return (
- + {schema.items && ( + + )}
{!isConnected && (schema.items ? (