From fc94d22d03cd9e7c24977257cbec912ad72c79da Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Mon, 3 Apr 2006 14:44:28 +0000 Subject: length check --- lib/python/Components/MovieList.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/MovieList.py b/lib/python/Components/MovieList.py index a47741c4..2e861472 100644 --- a/lib/python/Components/MovieList.py +++ b/lib/python/Components/MovieList.py @@ -60,7 +60,10 @@ class MovieList(HTMLComponent, GUIComponent): return self.instance.getCurrentIndex() def getCurrent(self): - return self.l.getCurrentSelection()[0] + l = self.l.getCurrentSelection() + if l is not None: + return self.l.getCurrentSelection()[0] + return None def GUIcreate(self, parent): self.instance = eListbox(parent) @@ -88,9 +91,10 @@ class MovieList(HTMLComponent, GUIComponent): return len(self.list) def updateLengthOfIndex(self, index): - x = self.list[index] - self.list[index] = (x[0], x[1], x[2], x[1].getLength(x[0])) - self.l.invalidateEntry(index) + if len(self.list) > index: + x = self.list[index] + self.list[index] = (x[0], x[1], x[2], x[1].getLength(x[0])) + self.l.invalidateEntry(index) def load(self, root): # this lists our root service, then building a -- cgit v1.2.3