fix subtitle configlist crash
authorFraxinas <andreas.frisch@multimedia-labs.de>
Wed, 9 Jun 2010 00:32:29 +0000 (02:32 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 6 Oct 2010 21:44:23 +0000 (23:44 +0200)
lib/python/Components/ConfigList.py

index 418a1b67e0a6981c40189d4f830c945a5417ca11..ffbc69af254c344f62cfd6882bc15bafd6743abc 100755 (executable)
@@ -61,12 +61,13 @@ class ConfigList(HTMLComponent, GUIComponent, object):
        GUI_WIDGET = eListbox
        
        def selectionChanged(self):
        GUI_WIDGET = eListbox
        
        def selectionChanged(self):
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onDeselect(self.session)
                self.current = self.getCurrent()
                        self.current[1].onDeselect(self.session)
                self.current = self.getCurrent()
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onSelect(self.session)
                        self.current[1].onSelect(self.session)
-
+               else:
+                       return
                for x in self.onSelectionChanged:
                        x()
 
                for x in self.onSelectionChanged:
                        x()
 
@@ -75,11 +76,11 @@ class ConfigList(HTMLComponent, GUIComponent, object):
                instance.setContent(self.l)
        
        def preWidgetRemove(self, instance):
                instance.setContent(self.l)
        
        def preWidgetRemove(self, instance):
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onDeselect(self.session)
                instance.selectionChanged.get().remove(self.selectionChanged)
                instance.setContent(None)
                        self.current[1].onDeselect(self.session)
                instance.selectionChanged.get().remove(self.selectionChanged)
                instance.setContent(None)
-       
+
        def setList(self, l):
                self.timer.stop()
                self.__list = l
        def setList(self, l):
                self.timer.stop()
                self.__list = l