Added null check for chrome (#3398)

This commit is contained in:
Erik Jan de Wit 2022-09-27 10:58:03 +02:00 committed by GitHub
parent 59d5c3dc94
commit 498e345281
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,8 @@ export const FileUpload: React.FunctionComponent<FileUploadProps> = ({
const onDropAccepted = (acceptedFiles: File[], event: DropEvent) => { const onDropAccepted = (acceptedFiles: File[], event: DropEvent) => {
if (acceptedFiles.length > 0) { if (acceptedFiles.length > 0) {
const fileHandle = acceptedFiles[0]; const fileHandle = acceptedFiles[0];
if (event.type === "drop") { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (event?.type === "drop") {
onFileInputChange?.(event, fileHandle); onFileInputChange?.(event, fileHandle);
} }
if (type === fileReaderType.text || type === fileReaderType.dataURL) { if (type === fileReaderType.text || type === fileReaderType.dataURL) {