mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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 'setting current page', position.page
|
||||
pagenum = position.page
|
||||
if pagenum > $scope.numPages - 1
|
||||
pagenum = $scope.numPages - 1
|
||||
$scope.pages[pagenum].current = true
|
||||
$scope.pages[pagenum].position = position
|
||||
|
||||
|
|
Loading…
Reference in a new issue