InfoBarGenerics: Avoid GSOD for plugins that use NumberZap
authorLittlesat <littlesat99@yahoo.com>
Thu, 13 Sep 2012 17:22:22 +0000 (19:22 +0200)
committerLittlesat <littlesat99@yahoo.com>
Thu, 13 Sep 2012 17:22:22 +0000 (19:22 +0200)
E.g. Permanent Time Shift but the NameZap function will not be functional
then.

lib/python/Screens/InfoBarGenerics.py

index a1ff27e..b10f013 100644 (file)
@@ -296,8 +296,9 @@ class NumberZap(Screen):
                self.close(self.service, self.bouquet)
 
        def handleServiceName(self):
-               self.service, self.bouquet = self.searchNumber(int(self["number"].getText()))
-               self ["servicename"].text = ServiceReference(self.service).getServiceName()
+               if not self.searchNumber is None:
+                       self.service, self.bouquet = self.searchNumber(int(self["number"].getText()))
+                       self ["servicename"].text = ServiceReference(self.service).getServiceName()
 
        def keyNumberGlobal(self, number):
                self.Timer.start(3000, True)            #reset timer
@@ -309,7 +310,7 @@ class NumberZap(Screen):
                if len(self.field) >= 5:
                        self.keyOK()
 
-       def __init__(self, session, number, searchNumberFunction):
+       def __init__(self, session, number, searchNumberFunction = None):
                Screen.__init__(self, session)
                self.field = str(number)
                self.searchNumber = searchNumberFunction