fix: prevent [object Object] rendering in 25 frontend components

Replace direct {error} JSX rendering with typeof check + .message fallback.
When error is an object (not a string), React showed [object Object].
Now renders error.message or fallback string.
This commit is contained in:
Agent Zero
2026-08-21 11:36:55 +02:00
parent 6555655ecf
commit e9b8936091
33 changed files with 37 additions and 37 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ export function ChatWindow({ sessionId, agentId, className, compact }: ChatWindo
</div>
)}
<ActivityIndicator status={activity} />
{error && <div className="mb-4 text-sm text-red-600">{error}</div>}
{error && <div className="mb-4 text-sm text-red-600">{typeof error === "string" ? error : (error as any)?.message || "Ein Fehler ist aufgetreten"}</div>}
</div>
<div className={clsx('border-t border-secondary-200', compact ? 'p-2' : 'p-4')}>
<div className="flex items-end gap-2">
+1 -1
View File
@@ -347,7 +347,7 @@ export function SessionList({ activeSessionId, onSelectSession, isSidebar, class
return (
<div className={clsx('flex flex-col h-full', className)}>
{error && <div className="p-2 text-xs text-red-600">{error}</div>}
{error && <div className="p-2 text-xs text-red-600">{typeof error === "string" ? error : (error as any)?.message || "Ein Fehler ist aufgetreten"}</div>}
<div
className="flex-1 overflow-y-auto p-2"
onContextMenu={(e) => {