mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
52 stars 7 forks source link

AttributeError: 'NoneType' object has no attribute 'time_taken' #96

Closed mortii closed 8 months ago

mortii commented 8 months ago
Caught exception:
Traceback (most recent call last):
  File "aqt.taskman", line 138, in _on_closures_pending
  File "aqt.taskman", line 82, in <lambda>
  File "aqt.taskman", line 102, in wrapped_done
  File "aqt.operations", line 260, in wrapped_done
  File "/home/neo/.local/share/Anki2/addons21/472573498/reviewing_utils.py", line 185, in _show_card
    mw.reviewer._initWeb()
  File "aqt.reviewer", line 319, in _initWeb
  File "aqt.reviewer", line 685, in _bottomHTML
AttributeError: 'NoneType' object has no attribute 'time_taken'

line 685, in _bottomHTML:

time=self.card.time_taken() // 1000,

@mortii I think the issue atleast with the self._showquestion is not that the reviewer is destroyed it's that the reviewer calls the function .cleanup which makes the card property be None. And when we manually call the self._showQuestion method the method assumes that card is not none they don't bother checking. Since _showQuestion is a private method they assume we wouldn't be using it. I think even you do use mw.reviewer you will still have to assert mw.reviewer.card

Looks like you were right @Vilhelm-Ian

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.