From e5420f8bd93476eb25a3ca4c2f3e91b33f00994f Mon Sep 17 00:00:00 2001 From: Bentlybro Date: Tue, 3 Feb 2026 11:50:06 +0000 Subject: [PATCH] fix: add proper type guard for obj.type --- .../frontend/src/components/atoms/FileInput/FileInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt_platform/frontend/src/components/atoms/FileInput/FileInput.tsx b/autogpt_platform/frontend/src/components/atoms/FileInput/FileInput.tsx index 26370ce8ab..ca4e5fefbc 100644 --- a/autogpt_platform/frontend/src/components/atoms/FileInput/FileInput.tsx +++ b/autogpt_platform/frontend/src/components/atoms/FileInput/FileInput.tsx @@ -109,7 +109,7 @@ export function FileInput(props: Props) { if (val && typeof val === "object") { const obj = val as Record; if (typeof obj.name === "string") { - return getFileLabel(obj.name, (obj.type as string) || ""); + return getFileLabel(obj.name, typeof obj.type === "string" ? obj.type : ""); } if (typeof obj.type === "string") { const mimeParts = obj.type.split("/");