diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj
index 40da5f35f9..a6911ea549 100644
--- a/src/pyj/read_book/iframe.pyj
+++ b/src/pyj/read_book/iframe.pyj
@@ -129,7 +129,8 @@ class IframeBoss:
self.encrypted_communications = True
def onerror(self, msg, script_url, line_number, column_number, error_object):
- console.log(error_object)
+ if error_object:
+ console.log(error_object)
try:
fname = script_url.rpartition('/')[-1] or script_url
msg = msg + '
' + 'Error at {}:{}:{}'.format(fname, line_number, column_number or '') + ''