mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix error showing if user clicks in sidebar before it's rendered
https://forums.ankiweb.net/t/error-message-when-clicking-the-graph-of-card-ease/27541
This commit is contained in:
parent
0d92bd2ca8
commit
e9c5d24cbe
1 changed files with 4 additions and 3 deletions
|
@ -433,9 +433,10 @@ class SidebarTreeView(QTreeView):
|
|||
return True
|
||||
|
||||
def _on_search(self, index: QModelIndex) -> None:
|
||||
if item := self.model().item_for_index(index):
|
||||
if search_node := item.search_node:
|
||||
self.update_search(search_node)
|
||||
if model := self.model():
|
||||
if item := model.item_for_index(index):
|
||||
if search_node := item.search_node:
|
||||
self.update_search(search_node)
|
||||
|
||||
def _on_rename(self, item: SidebarItem, text: str) -> bool:
|
||||
new_name = text.replace('"', "")
|
||||
|
|
Loading…
Reference in a new issue