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; }