avoid exception in pdf viewer

if file was previously bigger, current position could be greater than
the number of pages
This commit is contained in:
Brian Gough 2015-01-12 16:47:38 +00:00
parent bf8bc27de0
commit 560919b78f

View file

@ -92,6 +92,8 @@ define [
# console.log 'position is', position.page, position.offset # console.log 'position is', position.page, position.offset
# console.log 'setting current page', position.page # console.log 'setting current page', position.page
pagenum = position.page pagenum = position.page
if pagenum > $scope.numPages - 1
pagenum = $scope.numPages - 1
$scope.pages[pagenum].current = true $scope.pages[pagenum].current = true
$scope.pages[pagenum].position = position $scope.pages[pagenum].position = position