From: Felix Domke Date: Tue, 19 Jun 2007 23:41:34 +0000 (+0000) Subject: return None (instead of crash) when list is empty, and getCurrent is called X-Git-Tag: 2.6.0~2149 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/4b058610123896242bfefcb0c55873fb0d2a6a93?hp=5e2d4c2933c5409409c8554293141ee0a12089f7 return None (instead of crash) when list is empty, and getCurrent is called --- diff --git a/lib/python/Components/Converter/StringList.py b/lib/python/Components/Converter/StringList.py index 4199212a..5d02e9ba 100644 --- a/lib/python/Components/Converter/StringList.py +++ b/lib/python/Components/Converter/StringList.py @@ -25,7 +25,7 @@ class StringList(Converter): @cached def getCurrent(self): - if self.source is None: + if self.source is None or self.index >= len(self.source.list): return None return self.source.list[self.index] @@ -41,5 +41,5 @@ class StringList(Converter): def setIndex(self, index): if self.master is not None: self.master.index = index - + index = property(getIndex, setIndex)