catch wrong objects in add-on conf

based on patch from Arthur: https://github.com/dae/anki/pull/261/files
This commit is contained in:
Damien Elmes 2018-11-18 15:22:31 +10:00
parent 204ed5c18a
commit e4af18cf66

View file

@ -499,6 +499,10 @@ class ConfigEditor(QDialog):
showInfo(_("Invalid configuration: ") + repr(e))
return
if not isinstance(new_conf, dict):
showInfo(_("Invalid configuration: top level object must be a map"))
return
if new_conf != self.conf:
self.mgr.writeConfig(self.addon, new_conf)
# does the add-on define an action to be fired?