You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: 'NoneType' object is not subscriptable
(7 additional frame(s) were not displayed)
...
File "1322529746\gui\operations\db_check\anki_db_check.py", line 51, in <lambda>
lambda: _reset_decks(ah_dids_with_missing_ah_nids),
File "1322529746\gui\operations\db_check\anki_db_check.py", line 114, in _reset_decks
reset_local_changes_to_notes(nids, ankihub_deck_uuid=ah_did)
File "1322529746\reset_local_changes.py", line 34, in reset_local_changes_to_notes
notes_data = [
File "1322529746\reset_local_changes.py", line 37, in <listcomp>
if (note_data := ankihub_db.note_data(nid)) is not None
File "1322529746\db\db.py", line 305, in note_data
field["name"] for field in aqt.mw.col.models.get(NotetypeId(mid))["flds"]
Sentry Issue: ANKIHUB_ADDON-41C
The error happens because a note type is missing from the anki database and the code assumes that it exists.
The weird thing is that the note type should exist at this point in the execution, because of this code:
https://github.com/ankipalace/ankihub_addon/blob/2c739cda0c9ee6e14604d5fcc21dcf2f31558397/ankihub/reset_local_changes.py#L24-L32
When looking at the logs of users they say that the missing note type was created before the error happens.
I tried to reproduce the error by installing the AnkiHub deck, removing the
IO-one by one (AnKing / AnKingMed)
note type and resetting local changes to simulate a situation like in this event: https://ankihub.sentry.io/issues/4253438621/events/5ba8f183d8284cb49b6df56f817680ca/?project=6546414. I didn't get any error.The text was updated successfully, but these errors were encountered: