Replace optional chaining with the traditional way
Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user