diff --git a/aqt/editor.py b/aqt/editor.py index 845f70ad4..e7560fce8 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -133,6 +133,10 @@ function onBlur() { }; function saveField(type) { + if (!currentField) { + // no field has been focused yet + return; + } // type is either 'blur' or 'key' py.run(type + ":" + currentField.innerHTML); clearChangeTimer();