From: ghost Date: Wed, 11 Feb 2009 14:20:10 +0000 (+0100) Subject: fix possible crash X-Git-Tag: 2.6.0~454 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/6d7d1767d32a95d94c817129be77147885e850fa?ds=sidebyside fix possible crash --- diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index eaf07180..f72a4c4e 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -198,12 +198,15 @@ class choicesList(object): # XXX: we might want a better name for this self.choices[value] = orig def default(self): + choices = self.choices + if not choices: + return "" if self.type is choicesList.LIST_TYPE_LIST: - default = self.choices[0] + default = choices[0] if isinstance(default, tuple): default = default[0] else: - default = self.choices.keys()[0] + default = choices.keys()[0] return default class descriptionList(choicesList): # XXX: we might want a better name for this