Skip to content

Commit 9e62340

Browse files
thaddeusreidokonet
authored andcommitted
fix: Check if this.fileInputEl is null (#561)
Fixes #560
1 parent 0eb69bb commit 9e62340

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,13 @@ class Dropzone extends React.Component {
239239
// execute the timeout only if the FileDialog is opened in the browser
240240
if (this.isFileDialogActive) {
241241
setTimeout(() => {
242-
// Returns an object as FileList
243-
const { files } = this.fileInputEl
242+
if (this.fileInputEl != null) {
243+
// Returns an object as FileList
244+
const { files } = this.fileInputEl
244245

245-
if (!files.length) {
246-
this.isFileDialogActive = false
246+
if (!files.length) {
247+
this.isFileDialogActive = false
248+
}
247249
}
248250

249251
if (typeof onFileDialogCancel === 'function') {
@@ -439,8 +441,8 @@ Dropzone.propTypes = {
439441
disableClick: PropTypes.bool,
440442

441443
/**
442-
* Enable/disable the dropzone entirely
443-
*/
444+
* Enable/disable the dropzone entirely
445+
*/
444446
disabled: PropTypes.bool,
445447

446448
/**

0 commit comments

Comments
 (0)