From a2650969a956a8d315add41b9fb762e81d8a5c00 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 14 Mar 2021 20:11:00 +0530 Subject: [PATCH] ... --- src/pyj/read_book/iframe.pyj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index c7ff0879b8..62d8918a52 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -429,9 +429,10 @@ class IframeBoss: if runtime.is_standalone_viewer: self.listen_for_image_double_clicks() self.content_ready = True - # this is the loading styles used to suppress scrollbars during load - # added in unserialize_html - document.head.removeChild(document.head.firstChild) + if document.head?.firstChild: + # this is the loading styles used to suppress scrollbars during load + # added in unserialize_html + document.head.removeChild(document.head.firstChild) csi = current_spine_item() if csi.initial_position: