diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-05-24 13:17:30 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-05-24 13:17:30 +0000 |
| commit | c142c89f08cefdb0984de7d004d4c3b2fa9f1ce2 (patch) | |
| tree | b0d61a63bb33d59c299955a192098828e2fc8665 /lib/python | |
| parent | 70a0ef2a3bf0824236b6b544f256ef9994bdffa5 (diff) | |
| download | enigma2-c142c89f08cefdb0984de7d004d4c3b2fa9f1ce2.tar.gz enigma2-c142c89f08cefdb0984de7d004d4c3b2fa9f1ce2.zip | |
don't crash if no plugins are available
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Screens/PluginBrowser.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py index fe81a33d..b3360b61 100644 --- a/lib/python/Screens/PluginBrowser.py +++ b/lib/python/Screens/PluginBrowser.py @@ -99,17 +99,22 @@ class PluginDownloadBrowser(Screen): }) def go(self): - if type(self["list"].l.getCurrentSelection()[0]) is str: # category - if self["list"].l.getCurrentSelection()[0] in self.expanded: - self.expanded.remove(self["list"].l.getCurrentSelection()[0]) + sel = self["list"].l.getCurrentSelection() + + if sel is None: + return + + if type(sel[0]) is str: # category + if sel[0] in self.expanded: + self.expanded.remove(sel[0]) else: - self.expanded.append(self["list"].l.getCurrentSelection()[0]) + self.expanded.append(sel[0]) self.updateList() else: if self.type == self.DOWNLOAD: - self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to download\nthe plugin \"" + self["list"].l.getCurrentSelection()[0].name + "\"?")) + self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to download\nthe plugin \"" + sel[0].name + "\"?")) elif self.type == self.REMOVE: - self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to REMOVE\nthe plugin \"" + self["list"].l.getCurrentSelection()[0].name + "\"?")) + self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to REMOVE\nthe plugin \"" + sel[0].name + "\"?")) def runInstall(self, val): if val: |
