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;