mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
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:
parent
bf8bc27de0
commit
560919b78f
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue