[deskbar-applet] Fixed bug #580548: Error in ActionsFactory when file doesn't exist



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]