diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-02-11 15:20:10 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2009-02-11 15:20:10 +0100 |
| commit | 6d7d1767d32a95d94c817129be77147885e850fa (patch) | |
| tree | 3208c025dbf0f6c5b48ad0a301870c0bfac651da /lib/python | |
| parent | 4e43f222adc69754295f64251753e3633bc68dd2 (diff) | |
| download | enigma2-6d7d1767d32a95d94c817129be77147885e850fa.tar.gz enigma2-6d7d1767d32a95d94c817129be77147885e850fa.zip | |
fix possible crash
Diffstat (limited to 'lib/python')
| -rwxr-xr-x | lib/python/Components/config.py | 7 |
1 files changed, 5 insertions, 2 deletions
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 |
