From 6e20dff6bf3f3048c27c51e56c097937d9e2ed1e Mon Sep 17 00:00:00 2001 From: Yasin Silavi <59373143+sttatusx@users.noreply.github.com> Date: Wed, 31 May 2023 22:03:11 +0330 Subject: [PATCH] Replace optional chaining with the traditional way Co-authored-by: Bill Thornton --- src/apps/stable/routes/user/userprofile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/stable/routes/user/userprofile.tsx b/src/apps/stable/routes/user/userprofile.tsx index 04b31785b4..bb0500da0f 100644 --- a/src/apps/stable/routes/user/userprofile.tsx +++ b/src/apps/stable/routes/user/userprofile.tsx @@ -102,7 +102,7 @@ const UserProfile: FunctionComponent = () => { const target = evt.target as HTMLInputElement; const file = (target.files as FileList)[0]; - if (!/image.*/.exec(file?.type)) { + if (!file || !/image.*/.exec(file.type)) { return false; }