Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception applying HTML template when condition applied #27

Open
NSBum opened this issue Jun 7, 2021 · 0 comments
Open

Exception applying HTML template when condition applied #27

NSBum opened this issue Jun 7, 2021 · 0 comments

Comments

@NSBum
Copy link

NSBum commented Jun 7, 2021

An exception occurs when attempting to apply a condition on an HTML asset.

The condition is valid ["card", "=", "ru2en"] and for this note type, I have a card named "ru2en". If I remove the card condition, the exception goes away, but of course, the asset gets applied to every card, which is not desirable.

Asset Manager version 2.1


Debug info:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-06-06 19:46:20
Add-ons possibly involved: ⁨Asset Manager⁩

Caught exception:
Traceback (most recent call last):
File "/Users/alan/Library/Application Support/Anki2/addons21/656021484/gui_config/config.py", line 58, in writeBackCurrentSetting
self.write_back_callback(*self.export_data())
File "/Users/alan/Library/Application Support/Anki2/addons21/656021484/src/models.py", line 22, in write_back
setup_model(model_id, html_data, script_data)
File "/Users/alan/Library/Application Support/Anki2/addons21/656021484/src/model_editor/init.py", line 9, in setup_model
setup_full(model_id, html, scripts)
File "/Users/alan/Library/Application Support/Anki2/addons21/656021484/src/model_editor/setup_html.py", line 200, in setup_full
if unminified := evaluate_fragment(
File "/Users/alan/Library/Application Support/Anki2/addons21/656021484/src/model_editor/setup_html.py", line 143, in evaluate_fragment
text = base.code
AttributeError: 'NoneType' object has no attribute 'code'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant