From 8de0e7e54c3ac29f05bcd6063efc9d4ec5af8411 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 10 Mar 2019 08:24:44 +1000 Subject: [PATCH] handle blur/key event before note id set can't reproduce the issue here, but presumably this change will work around https://anki.tenderapp.com/discussions/ankidesktop/33038-bug-after-updatehtml-notes-wont-display --- aqt/editor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index 612c99cbd..deb0b85ed 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -248,7 +248,10 @@ class Editor: if cmd.startswith("blur") or cmd.startswith("key"): (type, ord, nid, txt) = cmd.split(":", 3) ord = int(ord) - nid = int(nid) + try: + nid = int(nid) + except ValueError: + nid = 0 if nid != self.note.id: print("ignored late blur") return