Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <silbe@activitycentral.com>2011-11-02 22:22:17 (GMT)
committer Sascha Silbe <silbe@activitycentral.com>2011-12-20 12:55:35 (GMT)
commit234d4629f8f6ceb87ae88cfc7bbe1fe02f3c7182 (patch)
tree9ddf67c9daf46bf99cc37ec58138ef9cd2e05197
parent02fc210e9368c5b8d295cf5d715a827f7715bb48 (diff)
Journal detail view: don't choke on invalid 'keep' propertyjournal-keep-invalid
Properties of data store entries can get corrupted, e.g. due to low level crashes or running out of battery (see OLPC#11372 [1] for a real-life example). In addition any activity can - accidentally or on purpose - write data store entries with arbitrary metadata. By comparing the 'keep' property as a string we can avoid the ValueError that might happen when trying to convert the property value to an integer. [1] https://dev.laptop.org/ticket/11372 Reported-by: Gary Martin <garycmartin@googlemail.com> Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
-rw-r--r--src/jarabe/journal/expandedentry.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py
index 4e99dc2..da6b1bf 100644
--- a/src/jarabe/journal/expandedentry.py
+++ b/src/jarabe/journal/expandedentry.py
@@ -144,7 +144,7 @@ class ExpandedEntry(hippo.CanvasBox):
return
self._metadata = metadata
- self._keep_icon.keep = (int(metadata.get('keep', 0)) == 1)
+ self._keep_icon.keep = (str(metadata.get('keep', 0)) == '1')
self._icon = self._create_icon()
self._icon_box.clear()