From ce218d021f68dffb008b71b62defbebae4c7d9e3 Mon Sep 17 00:00:00 2001 From: benbro Date: Sat, 15 Jun 2013 17:04:54 +0300 Subject: [PATCH] Check that the progressCallback is defined before calling it --- src/api.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api.js b/src/api.js index 37d0c26c4..1d0bf133c 100644 --- a/src/api.js +++ b/src/api.js @@ -699,10 +699,12 @@ var WorkerTransport = (function WorkerTransportClosure() { }, this); messageHandler.on('DocProgress', function transportDocProgress(data) { - this.progressCallback({ - loaded: data.loaded, - total: data.total - }); + if (this.progressCallback) { + this.progressCallback({ + loaded: data.loaded, + total: data.total + }); + } }, this); messageHandler.on('DocError', function transportDocError(data) {