This commit is contained in:
Kovid Goyal 2024-10-04 20:28:51 +05:30
parent 1fb12b929e
commit ece05c6215
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -167,7 +167,7 @@ class Voices(QTreeWidget):
def set_item_downloaded_state(self, ans: QTreeWidgetItem) -> None:
voice = ans.data(0, Qt.ItemDataRole.UserRole)
is_downloaded = bool(voice.engine_data and voice.engine_data.get('is_downloaded'))
is_downloaded = bool(voice and voice.engine_data and voice.engine_data.get('is_downloaded'))
ans.setFont(0, self.highlight_font if is_downloaded else self.normal_font)
def set_voices(self, all_voices: tuple[Voice, ...], current_voice: str, engine_metadata: EngineMetadata) -> None: