From d86694881efde83122aa98857ef714bfa403eca6 Mon Sep 17 00:00:00 2001 From: Manasvi Gaur <120303997+manasvi-gaur@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:06:19 +0530 Subject: [PATCH] Solved File Management Exceptions (#7390) * File Management Exceptions Solved * added return statement * change request done * change suggestion done * done * final commit --- src/Components/Patient/FileUpload.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Patient/FileUpload.tsx b/src/Components/Patient/FileUpload.tsx index f0fe5cc55d1..804dedcde10 100644 --- a/src/Components/Patient/FileUpload.tsx +++ b/src/Components/Patient/FileUpload.tsx @@ -905,8 +905,8 @@ export const FileUpload = (props: FileUploadProps) => { } const onFileChange = (e: ChangeEvent): any => { - if (e.target.files == null) { - throw new Error("Error finding e.target.files"); + if (!e.target.files?.length) { + return; } const f = e.target.files[0]; const fileName = f.name;