mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
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:
parent
204ed5c18a
commit
e4af18cf66
1 changed files with 4 additions and 0 deletions
|
@ -499,6 +499,10 @@ class ConfigEditor(QDialog):
|
||||||
showInfo(_("Invalid configuration: ") + repr(e))
|
showInfo(_("Invalid configuration: ") + repr(e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not isinstance(new_conf, dict):
|
||||||
|
showInfo(_("Invalid configuration: top level object must be a map"))
|
||||||
|
return
|
||||||
|
|
||||||
if new_conf != self.conf:
|
if new_conf != self.conf:
|
||||||
self.mgr.writeConfig(self.addon, new_conf)
|
self.mgr.writeConfig(self.addon, new_conf)
|
||||||
# does the add-on define an action to be fired?
|
# does the add-on define an action to be fired?
|
||||||
|
|
Loading…
Reference in a new issue