don't crash when video modes are broken
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 6 Oct 2009 07:37:10 +0000 (09:37 +0200)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 6 Oct 2009 07:37:10 +0000 (09:37 +0200)
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py

index bceb6bc7e42dd2d4259a3736bf96428bc7a71153..3759c21af13e4f66bde3e1c2af8fffc1cf31144a 100644 (file)
@@ -105,8 +105,9 @@ class VideoWizard(WizardLanguage, Rc):
                modeList = self.hw.getModeList(self.selection)
                print "modeList:", modeList
                self.port = port
-               ratesList = self.listRates(modeList[0][0])
-               self.hw.setMode(port = port, mode = modeList[0][0], rate = ratesList[0][0])
+               if (len(modeList) > 0):
+                       ratesList = self.listRates(modeList[0][0])
+                       self.hw.setMode(port = port, mode = modeList[0][0], rate = ratesList[0][0])
                
        def listModes(self):
                list = []