[deskbar-applet] Fixed bug #580548: Error in ActionsFactory when file doesn't exist
- From: Sebastian Polsterl <sebp src gnome org>
- To: svn-commits-list gnome org
- Subject: [deskbar-applet] Fixed bug #580548: Error in ActionsFactory when file doesn't exist
- Date: Tue, 28 Apr 2009 08:43:23 -0400 (EDT)
commit a3d662168825ddfce7694e3f19827d211c90099e
Author: Sebastian Pölsterl <sebp k-d-w org>
Date: Tue Apr 28 14:42:11 2009 +0200
Fixed bug #580548: Error in ActionsFactory when file doesn't exist
---
deskbar/handlers/actions/ActionsFactory.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/deskbar/handlers/actions/ActionsFactory.py b/deskbar/handlers/actions/ActionsFactory.py
index ca5e247..8f80d63 100644
--- a/deskbar/handlers/actions/ActionsFactory.py
+++ b/deskbar/handlers/actions/ActionsFactory.py
@@ -28,8 +28,14 @@ def get_actions_for_uri(uri, display_name=None):
if display_name == None:
display_name = gfile.get_basename()
+ # Check if file exists
+ path = gfile.get_path()
+ if path == None:
+ LOGGER.warning("File %s does not exist", uri)
+ return []
+
# If we have a directory only return one action
- if isdir(gfile.get_path()):
+ if isdir(path):
return [CopyToClipboardAction( _("Location"), gfile.get_path())]
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]