Check that the progressCallback is defined before calling it

This commit is contained in:
benbro 2013-06-15 17:04:54 +03:00 committed by Yury Delendik
parent cf01c92b6f
commit ce218d021f

View File

@ -699,10 +699,12 @@ var WorkerTransport = (function WorkerTransportClosure() {
}, this); }, this);
messageHandler.on('DocProgress', function transportDocProgress(data) { messageHandler.on('DocProgress', function transportDocProgress(data) {
this.progressCallback({ if (this.progressCallback) {
loaded: data.loaded, this.progressCallback({
total: data.total loaded: data.loaded,
}); total: data.total
});
}
}, this); }, this);
messageHandler.on('DocError', function transportDocError(data) { messageHandler.on('DocError', function transportDocError(data) {