gregorias / anki-code-highlighter

Anki plugin for code syntax highlighting.
GNU Affero General Public License v3.0
59 stars 3 forks source link

The addon crashes on multiprofile setups #22

Closed gregorias closed 1 year ago

gregorias commented 1 year ago

Reproduction

  1. Have multiple profiles set up in Anki.
  2. Start Anki (with the addon installed).

Anki will throw the following error in profile selection:

Traceback (most recent call last):
  File "aqt.progress", line 118, in handler
  File "aqt.main", line 198, in on_window_init
  File "aqt.hooks_gen", line 2801, in __call__
  File "/Users/grzesiek/Library/Application Support/Anki2/addons21/112228974/main.py", line 142, in setup_menu
    anki_asset_manager = create_anki_asset_manager(main_window.col)
  File "/Users/grzesiek/Library/Application Support/Anki2/addons21/112228974/main.py", line 45, in create_anki_asset_manager
    col.models), col.media, ASSET_PREFIX,
AttributeError: 'NoneType' object has no attribute 'models'