mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix a harmless error when the book contains page list references whose targets do not exist. Fixes #2077871 [Error when changing chapters](https://bugs.launchpad.net/calibre/+bug/2077871)
This commit is contained in:
parent
8185000d0b
commit
30d6b30fec
@ -24,7 +24,7 @@ def ensure_anchor_cache_valid():
|
|||||||
def ensure_page_list_target_is_displayed(elem):
|
def ensure_page_list_target_is_displayed(elem):
|
||||||
# The stupid EPUB 3 examples have page list links pointing to
|
# The stupid EPUB 3 examples have page list links pointing to
|
||||||
# display:none divs. Sigh.
|
# display:none divs. Sigh.
|
||||||
if window.getComputedStyle(elem).display is 'none':
|
if elem and window.getComputedStyle(elem).display is 'none':
|
||||||
elem.textContent = ''
|
elem.textContent = ''
|
||||||
elem.setAttribute('style', 'all: revert')
|
elem.setAttribute('style', 'all: revert')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user