From 18116e8952dba28f45b94eababc86ae08e33a6ef Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sun, 01 Mar 2009 09:38:05 +0000 Subject: Support the case when an activity bundle is not completely downloaded and we need to display its icon #458 --- (limited to 'src') diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py index 52a86fa..7e6906a 100644 --- a/src/jarabe/journal/misc.py +++ b/src/jarabe/journal/misc.py @@ -65,13 +65,13 @@ def get_icon_name(metadata): if file_name is None and is_activity_bundle(metadata): file_path = model.get_file(metadata['uid']) - if os.path.exists(file_path): + if file_path is not None and os.path.exists(file_path): try: bundle = ActivityBundle(file_path) file_name = bundle.get_icon() - except Exception: + except: logging.warning('Could not read bundle:\n' + \ - ''.join(traceback.format_exception(*sys.exc_info()))) + traceback.format_exc()) if file_name is None: file_name = _get_icon_for_mime(metadata.get('mime_type', '')) -- cgit v0.9.1