dont crash when the satellites.xml does not exist or is empty
[enigma2.git] / lib / python / Screens / Satconfig.py
index 5415ae05a577b4e18ca5cb3de4a9be63ad92955f..398a13e117b2a8c31f0def8a580d83b582e9aff8 100644 (file)
@@ -64,6 +64,7 @@ class NimSetup(Screen, ConfigListScreen):
                self.turnFastEpochEnd = None
                self.uncommittedDiseqcCommand = None
                self.cableScanType = None
+               self.have_advanced = False
 
                if self.nim.isCompatible("DVB-S"):
                        self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
@@ -84,11 +85,12 @@ class NimSetup(Screen, ConfigListScreen):
                                self.list.append(self.advancedSatsEntry)
                                cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
                                satlist = self.nimConfig.advanced.sat.keys()
-                               if cur_orb_pos not in satlist:
-                                       cur_orb_pos = satlist[0]
-                               currSat = self.nimConfig.advanced.sat[cur_orb_pos]
-                               self.fillListWithAdvancedSatEntrys(currSat)
-                       self.have_advanced = True
+                               if cur_orb_pos is not None:
+                                       if cur_orb_pos not in satlist:
+                                               cur_orb_pos = satlist[0]
+                                       currSat = self.nimConfig.advanced.sat[cur_orb_pos]
+                                       self.fillListWithAdvancedSatEntrys(currSat)
+                               self.have_advanced = True
                elif self.nim.isCompatible("DVB-C"):
                        self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
                        self.list.append(self.configMode)