jdlorimer / incremental-reading

Anki add-on providing incremental reading features
https://ankiweb.net/shared/info/935264945
ISC License
216 stars 38 forks source link

<class 'TypeError'>: 'NoneType' object is not subscriptable (Windows, Anki 2.1.8) #92

Open tinkerrc opened 5 years ago

tinkerrc commented 5 years ago

I was editing deleting unused note types and renaming note types. I was also changing note types in the browser before. (Not sure how they are related) The following error occurs every time I scroll at the main window after that:

Anki 2.1.8 (71e0c880) Python 3.6.7 Qt 5.12.0 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\view.py", line 110, in saveScroll
    if viewingIrText():
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 38, in viewingIrText
    if (isIrCard(mw.reviewer.card) and
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 30, in isIrCard
    if (card and (card.model()['name'] ==
<class 'TypeError'>: 'NoneType' object is not subscriptable
Caught exception:
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\view.py", line 110, in saveScroll
    if viewingIrText():
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 38, in viewingIrText
    if (isIrCard(mw.reviewer.card) and
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 30, in isIrCard
    if (card and (card.model()['name'] ==
<class 'TypeError'>: 'NoneType' object is not subscriptable
Caught exception:
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\view.py", line 110, in saveScroll
    if viewingIrText():
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 38, in viewingIrText
    if (isIrCard(mw.reviewer.card) and
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 30, in isIrCard
    if (card and (card.model()['name'] ==
<class 'TypeError'>: 'NoneType' object is not subscriptable
Caught exception:
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\view.py", line 110, in saveScroll
    if viewingIrText():
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 38, in viewingIrText
    if (isIrCard(mw.reviewer.card) and
  File "C:\Users\theoa\AppData\Roaming\Anki2\addons21\935264945\util.py", line 30, in isIrCard
    if (card and (card.model()['name'] ==
<class 'TypeError'>: 'NoneType' object is not subscriptable

I tried to rename the note type back to "IR3" and the error persists. The error disappears when I relaunch Anki. (full upload)

tvhong commented 1 year ago

I know it has been a while, but do you have extract reproduction steps?