From ab56d48002a71d2b99715f7f8570589c4b8c4e9a Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 30 Nov 2023 16:17:35 -0300 Subject: [PATCH] fix(inputFileComponent): handle case when fileTypes prop is undefined to prevent error when checking file type The checkFileType function in the InputFileComponent component now handles the case when the fileTypes prop is undefined. This prevents an error from occurring when checking the file type of the selected file. --- src/frontend/src/components/inputFileComponent/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index 0f8f159fc..b87e5e5f5 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -28,6 +28,7 @@ export default function InputFileComponent({ }, [disabled, onChange]); function checkFileType(fileName: string): boolean { + if (fileTypes === undefined) return true; for (let index = 0; index < fileTypes.length; index++) { if (fileName.endsWith(fileTypes[index])) { return true;