Browse Source

if blob is empty on paste, log errors and return, skip `addFile`

Artur Paikin 7 years ago
parent
commit
c404e1b434
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/plugins/Dashboard/Dashboard.js

+ 6 - 1
src/plugins/Dashboard/Dashboard.js

@@ -33,7 +33,12 @@ module.exports = function Dashboard (props) {
       if (file.kind !== 'file') return
 
       const blob = file.getAsFile()
-      props.log('File pasted')
+      if (!blob) {
+        props.log('[Dashboard] File pasted, but the file blob is empty')
+        props.info('Error pasting file', 'error')
+        return
+      }
+      props.log('[Dashboard] File pasted')
       props.addFile({
         source: props.id,
         name: file.name,