Fix error when event.dataTransfer.files is empty

Changelog-entry: Fix error when event.dataTransfer.files is empty
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2019-02-27 18:30:45 +01:00
parent f0374cf9d9
commit 5299d958f2

View File

@ -51,9 +51,11 @@ module.exports = ($timeout) => {
domElement.ondrop = (event) => {
event.preventDefault()
if (event.dataTransfer.files.length) {
const filename = _.first(event.dataTransfer.files).path
// Safely bring this to the word of Angular
// Safely bring this to the world of Angular
$timeout(() => {
scope.osDropzone({
@ -63,6 +65,7 @@ module.exports = ($timeout) => {
})
})
}
return false
}