Commit 4689a245257fb4fbdda64f8199082f40541fdee4
Handle file input cancelled
If no file is selected, abort processingCharles Lehner committed on 9/9/2016, 4:19:49 PM
Parent: 254d428707404f153d5ee3cb7519467096be0cc7
Files changed
modules/file-input.js | changed |
modules/file-input.js | ||
---|---|---|
@@ -12,8 +12,9 @@ | ||
12 | 12 | |
13 | 13 | return h('input', { type: 'file', |
14 | 14 | onchange: function (ev) { |
15 | 15 | var file = ev.target.files[0] |
16 | + if (!file) return | |
16 | 17 | var reader = new FileReader() |
17 | 18 | reader.onload = function () { |
18 | 19 | pull( |
19 | 20 | pull.values(split(new Buffer(reader.result), 64*1024)), |
Built with git-ssb-web