summaryrefslogtreecommitdiff
path: root/searx/preferences.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2017-01-21 20:08:08 +0100
committerAdam Tauber <asciimoo@gmail.com>2017-01-21 20:08:08 +0100
commitfa26afafd877ec655ab40c42e83a92c9be9d279c (patch)
tree3adccfe4125bf7073f6eb96c1486583211bc05fa /searx/preferences.py
parent3a57a1a0d096f9b15eab14c65c9c2bab432097d5 (diff)
downloadsearxng-fa26afafd877ec655ab40c42e83a92c9be9d279c.tar.gz
searxng-fa26afafd877ec655ab40c42e83a92c9be9d279c.zip
[fix] handle missing mapsettings
Diffstat (limited to 'searx/preferences.py')
-rw-r--r--searx/preferences.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/preferences.py b/searx/preferences.py
index 3aeb87e9f..719492460 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -130,7 +130,8 @@ class MapSetting(Setting):
self.key = data
def save(self, name, resp):
- resp.set_cookie(name, bytes(self.key), max_age=COOKIE_MAX_AGE)
+ if hasattr(self, 'key'):
+ resp.set_cookie(name, bytes(self.key), max_age=COOKIE_MAX_AGE)
class SwitchableSetting(Setting):