From 498e34528163a3be0ab75451eb27ea945e41464c Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Tue, 27 Sep 2022 10:58:03 +0200 Subject: [PATCH] Added null check for chrome (#3398) --- .../src/components/json-file-upload/patternfly/FileUpload.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/admin-ui/src/components/json-file-upload/patternfly/FileUpload.tsx b/apps/admin-ui/src/components/json-file-upload/patternfly/FileUpload.tsx index c87855d0d3..987545f644 100644 --- a/apps/admin-ui/src/components/json-file-upload/patternfly/FileUpload.tsx +++ b/apps/admin-ui/src/components/json-file-upload/patternfly/FileUpload.tsx @@ -117,7 +117,8 @@ export const FileUpload: React.FunctionComponent = ({ const onDropAccepted = (acceptedFiles: File[], event: DropEvent) => { if (acceptedFiles.length > 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); } if (type === fileReaderType.text || type === fileReaderType.dataURL) {