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
This commit is contained in:
Damien Elmes 2019-03-10 08:24:44 +10:00
parent 858442a4c9
commit 8de0e7e54c

View File

@ -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