translate text attribute for skin objects
[enigma2.git] / ServiceReference.py
index 8627e9fc1162c2bbf6f468277e488cc7a46593ce..787c5c4aa0d58fd0d5a6649cb884fc3691688402 100644 (file)
@@ -5,9 +5,10 @@ import NavigationInstance
 
 class ServiceReference(eServiceReference):
        def __init__(self, ref):
-               if isinstance(ref, str):
-                       ref = eServiceReference(ref)
-               self.ref = ref
+               if not isinstance(ref, eServiceReference):
+                       self.ref = eServiceReference(ref or "")
+               else:
+                       self.ref = ref
                self.serviceHandler = eServiceCenter.getInstance()
 
        def __str__(self):
@@ -15,10 +16,7 @@ class ServiceReference(eServiceReference):
        
        def getServiceName(self):
                info = self.info()
-               if info is None:
-                       return None
-               
-               return info.getName(self.ref)
+               return info and info.getName(self.ref) or ""
 
        def play(self):
                return self.serviceHandler.info(self.ref)