ignore requests to invalidate non-existing entries
authorFelix Domke <tmbinc@elitedvb.net>
Sat, 18 Nov 2006 10:45:59 +0000 (10:45 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sat, 18 Nov 2006 10:45:59 +0000 (10:45 +0000)
lib/python/Components/ConfigList.py

index 2de075c..4dd401f 100644 (file)
@@ -46,9 +46,12 @@ class ConfigList(HTMLComponent, GUIComponent, object):
        
        def invalidateCurrent(self):
                self.l.invalidateEntry(self.l.getCurrentSelectionIndex())
-               
+
        def invalidate(self, entry):
-               self.l.invalidateEntry(self.__list.index(entry))
+               # when the entry to invalidate does not exist, just ignore the request.
+               # this eases up conditional setup screens a lot.
+               if entry in self.__list:
+                       self.l.invalidateEntry(self.__list.index(entry))
 
        GUI_WIDGET = eListbox