From: Kalervo Kujala Date: Sat, 6 Aug 2011 20:33:07 +0000 (+0300) Subject: Avoid browser-test stoppage when task.pdfDoc is undefined. X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b1ea9332b8ca0a80884e535a5977486b81646e73;p=pdf.js.git Avoid browser-test stoppage when task.pdfDoc is undefined. If nextTask leaves task.pdfDoc as undefined then sendTaskResult will fail on that. SendTaskResult tries to access task.pdfDoc.numPages which cannot succeed. This leads to a complete stop in the browser-test. --- diff --git a/test/driver.js b/test/driver.js index 8d25539..642c527 100644 --- a/test/driver.js +++ b/test/driver.js @@ -79,7 +79,7 @@ function nextTask() { } function isLastPage(task) { - return (task.pdfDoc && (task.pageNum > task.pdfDoc.numPages)); + return (!task.pdfDoc || (task.pageNum > task.pdfDoc.numPages)); } function nextPage(task, loadError) {