From e4af18cf66666905c71710c4f7d862670c58d16d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 18 Nov 2018 15:22:31 +1000 Subject: [PATCH] catch wrong objects in add-on conf based on patch from Arthur: https://github.com/dae/anki/pull/261/files --- aqt/addons.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aqt/addons.py b/aqt/addons.py index a8d218c16..7312d39d5 100644 --- a/aqt/addons.py +++ b/aqt/addons.py @@ -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?