Anki/aqt
Thomas TEMPÉ 3d81ef2c68 Avoid calling checkValid on an empty note
Fix error message when editFocusLost is called after editor destruction

https://anki.tenderapp.com/discussions/ankidesktop/11175-bug-in-browser-revealed-by-add-on?unresolve=true
To reproduce:
1. Install the attached add-on. (All it does is register a function on the editFocusLost hook, and set the flag to 1 to signify that a field has been updated).
2. Run Anki. Enter the Browse window. Press Enter to display your deck.
3. Select one card.
4. Click inside one of the fields for that card. Now, when you leave that field, the editFocusLost hook will be called.
5. Now, select 2 notes from the browser, with your mouse, without clicking anywhere else before.

You will observe this error message:

Traceback (most recent call last):
File "aqt/progress.pyc", line 69, in handler 
File "aqt/editor.pyc", line 467, in onUpdate 
File "aqt/editor.pyc", line 572, in checkValid AttributeError: 'NoneType' object has no attribute 'fields'
2014-12-31 22:36:12 +08:00
..
__init__.py start new instance if existing instance hung 2014-08-26 15:25:22 +09:00
about.py add C. van Rooyen to contributors 2014-08-17 13:46:08 -05:00
addcards.py Revert "fix some memory leaks" 2014-03-27 13:58:30 +09:00
addons.py make sure we write addon .py files as they've been uploaded 2014-08-09 13:28:48 +09:00
browser.py Load saved searches list in sorted order 2014-11-11 10:13:29 +11:00
clayout.py allow all ankiwebview instances to take focus 2014-09-15 15:04:14 +09:00
customstudy.py increase custom study size limit as well 2014-01-14 15:45:12 +09:00
deckbrowser.py add "export" button to deck menus 2014-06-19 19:13:12 -05:00
deckchooser.py remember window size for deck&model selection (#931) 2013-09-20 14:51:12 +09:00
deckconf.py dialog box size and position improvements 2014-06-20 10:31:52 -05:00
downloader.py make sure we decode full traceback on addon err (#954) 2013-09-20 15:02:46 +09:00
dyndeckconf.py dialog box size and position improvements 2014-06-20 10:31:52 -05:00
editcurrent.py accept Ctrl-Enter to close the edit current dialog 2014-08-31 14:41:08 -05:00
editor.py Avoid calling checkValid on an empty note 2014-12-31 22:36:12 +08:00
errors.py disable more useful msg in disk i/o error case 2014-07-22 08:01:19 +09:00
exporting.py fall back to homedir on collection package export if no desktop 2014-08-05 11:25:24 -05:00
fields.py optimize imports 2012-12-22 09:17:10 +09:00
importing.py catch more invalid zip file errors 2014-09-27 10:19:43 -05:00
main.py be explicit about modSchema()'s check flag 2014-11-03 16:28:12 +09:00
modelchooser.py remember window size for deck&model selection (#931) 2013-09-20 14:51:12 +09:00
models.py dialog box size and position improvements 2014-06-20 10:31:52 -05:00
overview.py fix 1000 cap in overview screen 2014-02-06 05:33:58 +09:00
preferences.py be explicit about modSchema()'s check flag 2014-11-03 16:28:12 +09:00
profiles.py make sure .db is initialized at start of profiles init 2014-08-09 12:50:32 +09:00
progress.py allow app modal again now that qt's been fixed 2014-04-23 08:20:00 +09:00
qt.py stop providing pyqtconfig, as it's no longer available on newer plats 2014-03-06 09:04:28 +09:00
reviewer.py add css id to the star used for marking 2014-06-28 09:17:36 -05:00
sound.py optimize imports 2012-12-22 09:17:10 +09:00
stats.py check that save to desktop was successful before showing message 2014-06-17 08:44:26 -05:00
studydeck.py dialog box size and position improvements 2014-06-20 10:31:52 -05:00
sync.py catch another ssl error 2014-09-01 21:06:41 +09:00
tagedit.py pass enter back to qwidget so add tags dialog can close on enter 2013-05-27 11:37:35 +09:00
taglimit.py merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00
toolbar.py fix toolbar alignment issues (#191) 2013-05-24 12:40:41 +09:00
update.py display time difference & more info in clock off msg; i18n it 2013-10-20 10:26:11 +09:00
upgrade.py return of the evil bytestring windows exceptions 2013-10-20 11:01:57 +09:00
utils.py disable embedded fonts on osx 2014-09-27 10:26:14 +09:00
webview.py allow all ankiwebview instances to take focus 2014-09-15 15:04:14 +09:00