mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Check that the progressCallback is defined before calling it
This commit is contained in:
parent
cf01c92b6f
commit
ce218d021f
1 changed files with 6 additions and 4 deletions
10
src/api.js
10
src/api.js
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue