From: Andreas Monzner Date: Thu, 18 Jan 2007 00:14:16 +0000 (+0000) Subject: no more crash when press ok in a empty choicebox X-Git-Tag: 2.6.0~2438 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/9a8c3eab7a0823b5dfc6111f07a04cf05d00b57b no more crash when press ok in a empty choicebox --- diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index 37729887..b1d74ad5 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -74,7 +74,11 @@ class ChoiceBox(Screen): # runs the current selected entry def go(self): - self.goEntry(self["list"].l.getCurrentSelection()[0]) + cursel = self["list"].l.getCurrentSelection() + if cursel: + self.goEntry(cursel[0]) + else: + self.cancel() # runs a specific entry def goEntry(self, entry):