From 0e2e0ec55fff5368bce4bfbb4fe7bfc2312d80a2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 13 Apr 2021 12:10:08 +0530 Subject: [PATCH] Fix #1923317 [Private bug](https://bugs.launchpad.net/calibre/+bug/1923317) --- src/pyj/read_book/tts.pyj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyj/read_book/tts.pyj b/src/pyj/read_book/tts.pyj index d9e224b6c5..0ff26f1d74 100644 --- a/src/pyj/read_book/tts.pyj +++ b/src/pyj/read_book/tts.pyj @@ -205,7 +205,7 @@ class Client: parent_div.appendChild(E.input(type='range', id=rate_id, min=(self.min_rate * 10) + '', max=(self.max_rate * 10) + '', value=((self.current_rate or 1) * 10) + '')) parent_div.appendChild(E.div(_('Pick a voice below:'))) parent_div.appendChild(select) - if select.options.selectedIndex?: + if select.options.selectedIndex? and select.options[select.options.selectedIndex]: select.options[select.options.selectedIndex].scrollIntoView() parent_div.appendChild(E.div( style='margin: 1rem; display: flex; justify-content: space-between; align-items: flex-start',