add file check to upload
This commit is contained in:
parent
fe926382ce
commit
2b56ec6790
|
@ -146,6 +146,10 @@ var EmbarkJS =
|
|||
var self = this;
|
||||
var file = inputSelector[0].files[0];
|
||||
|
||||
if (file === undefined) {
|
||||
throw new Error('no file found');
|
||||
}
|
||||
|
||||
var promise = new Promise(function(resolve, reject) {
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function() {
|
||||
|
|
|
@ -99,6 +99,10 @@ EmbarkJS.Storage.uploadFile = function(inputSelector) {
|
|||
var self = this;
|
||||
var file = inputSelector[0].files[0];
|
||||
|
||||
if (file === undefined) {
|
||||
throw new Error('no file found');
|
||||
}
|
||||
|
||||
var promise = new Promise(function(resolve, reject) {
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function() {
|
||||
|
|
Loading…
Reference in New Issue