Skip to content

Commit f631f1f

Browse files
committed
no need for the constructor if it just calls super
1 parent 4c260e8 commit f631f1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/webc/file-byte-reader.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
class FileByteReader extends HTMLInputElement {
2-
constructor() {
3-
super();
4-
}
52
connectedCallback() {
63
this.addEventListener('change', this.onChange);
74
}
@@ -16,6 +13,7 @@ class FileByteReader extends HTMLInputElement {
1613
}
1714

1815
onChange() {
16+
if (this.files.length == 0) { return }
1917
const fileReader = new FileReader();
2018
fileReader.addEventListener('loadend', e => this.emit('loaded', new Int8Array(fileReader.result)));
2119
fileReader.readAsArrayBuffer(this.files[0]);

0 commit comments

Comments
 (0)