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
48 stars 6 forks source link

Crash when using deleted tags #161

Closed mortii closed 4 months ago

mortii commented 4 months ago

In the process of troubleshooting this issue, I encountered another issue. I created a new tag and then specified it in the "include" for the note filters so that I could narrow down which cards were causing it to crash. Once I figured it out, I deleted that new tag without removing it from the note filter first, which caused it to crash. I had to go back and re-create that tag, remove it from the note filter, and then I could delete that tag.

Originally posted by @xofm31 in https://github.com/mortii/anki-morphs/issues/159#issuecomment-1962927516

mortii commented 4 months ago

I haven't considered this scenario before, but I also don't know why that would cause a crash. I'll look into it.

mortii commented 4 months ago

Ah, it crashes when clicking the tags cell in the note filter settings, and gives this error:

Traceback (most recent call last):
  File "/home/neo/.local/share/Anki2/addons21/472573498/settings_dialog.py", line 796, in _tags_cell_clicked
    self.tag_selector.set_selected_tags_and_row(
  File "/home/neo/.local/share/Anki2/addons21/472573498/tag_selection_dialog.py", line 88, in set_selected_tags_and_row
    _include_checkbox: QCheckBox = get_checkbox_widget(
  File "/home/neo/.local/share/Anki2/addons21/472573498/table_utils.py", line 19, in get_checkbox_widget
    assert isinstance(widget, QCheckBox)
AssertionError

Just catching the exception and ignoring it should be fine I think. I'll try fixing it.

mortii commented 4 months ago

@xofm31 Fixed in v1.2.3, thanks!

github-actions[bot] commented 4 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.