[Sugar-devel] [PATCH] The activity icon does not handle the case of a activity without metadata.

Gonzalo Odiard godiard at sugarlabs.org
Thu Mar 31 11:21:19 EDT 2011


If the activity is initiated with create_object=False

Acked-by: Sascha Silbe <silbe at activitycentral.com>

---
 src/sugar/activity/widgets.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py
index b5e4ce7..ef23032 100644
--- a/src/sugar/activity/widgets.py
+++ b/src/sugar/activity/widgets.py
@@ -34,7 +34,7 @@ _ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
 
 
 def _create_activity_icon(metadata):
-    if metadata.get('icon-color', ''):
+    if metadata is not None and metadata.get('icon-color'):
         color = XoColor(metadata['icon-color'])
     else:
         client = gconf.client_get_default()
-- 
1.7.4



More information about the Sugar-devel mailing list