mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01: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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user