From 44298ca6d8299479d64cc5ac1211837998fdce57 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Wed, 9 Mar 2016 00:58:34 +0300 Subject: [PATCH] Zero changes?! --- www/mmwatch.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/mmwatch.py b/www/mmwatch.py index 8b683ac..0764f53 100755 --- a/www/mmwatch.py +++ b/www/mmwatch.py @@ -24,10 +24,14 @@ class Change(peewee.Model): changes = peewee.TextField() def changed_coord(self): - return json.loads(self.changes)[0] + changes = json.loads(self.changes) + return None if changes is None else changes[0] def changed_tags(self): - tags = json.loads(self.changes)[1] + changes = json.loads(self.changes) + if changes is None: + return {} + tags = json.loads(self.changes) for t in tags: if tags[t][0] is None: tags[t].append('create')