Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend/builder): guard msg.parts with nullish coalescing to prevent runtime error

Zamil Majdy72bc8a92dfef
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx
index 0a85de3009..23f600dc58 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx
@@ -275,7 +275,7 @@ function MessageList({
)}
>
{msg.role === "assistant"
- ? msg.parts.map((part, i) => {
+ ? (msg.parts ?? []).map((part, i) => {
// Normalize dynamic-tool parts → tool-{name} so MessagePartRenderer
// can route them: edit_agent/run_agent get their specific renderers,
// everything else falls through to GenericTool (collapsed accordion).