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.
This commit is contained in:
Kalervo Kujala 2011-08-06 23:33:07 +03:00
parent 17e02e3c39
commit b1ea9332b8

View File

@ -79,7 +79,7 @@ function nextTask() {
} }
function isLastPage(task) { function isLastPage(task) {
return (task.pdfDoc && (task.pageNum > task.pdfDoc.numPages)); return (!task.pdfDoc || (task.pageNum > task.pdfDoc.numPages));
} }
function nextPage(task, loadError) { function nextPage(task, loadError) {