]> git.parisson.com Git - pdf.js.git/commitdiff
Avoid browser-test stoppage when task.pdfDoc is undefined.
authorKalervo Kujala <kkujala@>
Sat, 6 Aug 2011 20:33:07 +0000 (23:33 +0300)
committerKalervo Kujala <kkujala@>
Sat, 6 Aug 2011 20:33:07 +0000 (23:33 +0300)
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.

test/driver.js

index 8d2553950aecae8d9f3177bf4f4e46686fdbf11a..642c5273c1a69309d3dd0bf9904150ada930d7d8 100644 (file)
@@ -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) {