mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -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
|
return True
|
||||||
|
|
||||||
def _on_search(self, index: QModelIndex) -> None:
|
def _on_search(self, index: QModelIndex) -> None:
|
||||||
if item := self.model().item_for_index(index):
|
if model := self.model():
|
||||||
if search_node := item.search_node:
|
if item := model.item_for_index(index):
|
||||||
self.update_search(search_node)
|
if search_node := item.search_node:
|
||||||
|
self.update_search(search_node)
|
||||||
|
|
||||||
def _on_rename(self, item: SidebarItem, text: str) -> bool:
|
def _on_rename(self, item: SidebarItem, text: str) -> bool:
|
||||||
new_name = text.replace('"', "")
|
new_name = text.replace('"', "")
|
||||||
|
|
Loading…
Reference in a new issue