fix error when opening browser during review while notes mode active

This commit is contained in:
Damien Elmes 2021-04-05 21:57:06 +10:00
parent 097121424b
commit 9c8148ff0d

View file

@ -149,10 +149,11 @@ class Table:
def select_single_card(self, card_id: CardId) -> None: def select_single_card(self, card_id: CardId) -> None:
"""Try to set the selection to the item corresponding to the given card.""" """Try to set the selection to the item corresponding to the given card."""
self.clear_selection() self.clear_selection()
try: if self.is_notes_mode():
self._view.selectRow(self._model.get_card_row(card_id)) self._view.selectRow(0)
except ValueError: else:
pass if (row := self._model.get_card_row(card_id)) is not None:
self._view.selectRow(row)
# Reset # Reset