mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Fix error on late editor_update_note() call
This commit is contained in:
parent
1809e793e6
commit
48fb272700
1 changed files with 4 additions and 3 deletions
|
@ -623,9 +623,10 @@ def editor_update_note() -> bytes:
|
||||||
response.ParseFromString(output)
|
response.ParseFromString(output)
|
||||||
|
|
||||||
def handle_on_main() -> None:
|
def handle_on_main() -> None:
|
||||||
window = aqt.mw.app.activeWindow()
|
handler = aqt.mw.app.activeWindow()
|
||||||
if window and isinstance(getattr(window, "editor"), Editor):
|
if handler and isinstance(getattr(handler, "editor", None), Editor):
|
||||||
on_op_finished(aqt.mw, response, window.editor) # type: ignore
|
handler = handler.editor # type: ignore
|
||||||
|
on_op_finished(aqt.mw, response, handler)
|
||||||
|
|
||||||
aqt.mw.taskman.run_on_main(handle_on_main)
|
aqt.mw.taskman.run_on_main(handle_on_main)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue