Replace optional chaining with the traditional way

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
Yasin Silavi
2023-05-31 22:03:11 +03:30
committed by GitHub
parent 13786b082d
commit 6e20dff6bf
+1 -1
View File
@@ -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;
}