From 9c8148ff0dec036c000ff3c2961d961da5c22e13 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 5 Apr 2021 21:57:06 +1000 Subject: [PATCH] fix error when opening browser during review while notes mode active --- qt/aqt/table.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qt/aqt/table.py b/qt/aqt/table.py index db10e19a0..aec9d7b71 100644 --- a/qt/aqt/table.py +++ b/qt/aqt/table.py @@ -149,10 +149,11 @@ class Table: def select_single_card(self, card_id: CardId) -> None: """Try to set the selection to the item corresponding to the given card.""" self.clear_selection() - try: - self._view.selectRow(self._model.get_card_row(card_id)) - except ValueError: - pass + if self.is_notes_mode(): + self._view.selectRow(0) + else: + if (row := self._model.get_card_row(card_id)) is not None: + self._view.selectRow(row) # Reset