Commit 17bc4593 authored by csillag's avatar csillag

Handle an init race condition

... when the bucket bar is being updated
before the document access strategy becomes
available. (This sometimes happens when using
PDF.js in the Chrome extension.)
parent bad15cc8
...@@ -188,6 +188,7 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin ...@@ -188,6 +188,7 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
# Get the page numbers # Get the page numbers
mapper = @annotator.domMapper mapper = @annotator.domMapper
return unless mapper? # Maybe it's too soon to do this
firstPage = 0 firstPage = 0
currentPage = mapper.getPageIndex() currentPage = mapper.getPageIndex()
lastPage = mapper.getPageCount() - 1 lastPage = mapper.getPageCount() - 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment