From 9a8c3eab7a0823b5dfc6111f07a04cf05d00b57b Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 18 Jan 2007 00:14:16 +0000 Subject: no more crash when press ok in a empty choicebox --- lib/python/Screens/ChoiceBox.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/python') 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): -- cgit v1.2.3