fix: add proper type guard for obj.type

This commit is contained in:
Bentlybro
2026-02-03 11:50:06 +00:00
parent 638e150a12
commit e5420f8bd9

View File

@@ -109,7 +109,7 @@ export function FileInput(props: Props) {
if (val && typeof val === "object") {
const obj = val as Record<string, unknown>;
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("/");