Make loading of variable slightly more bulletproof.

This commit is contained in:
Mattias Põldaru 2011-12-13 21:52:57 +02:00
parent 4f603d7353
commit 57d78d00df
1 changed files with 3 additions and 0 deletions

View File

@ -662,6 +662,9 @@ class SongImportForm(OpenLPWizard):
try:
last_import_type = int(QtCore.QSettings().value(
u'songs/last import type').toString())
if last_import_type >= self.formatComboBox.count() or \
last_import_type < 0:
last_import_type = 0
self.formatComboBox.setCurrentIndex(last_import_type)
except ValueError:
self.formatComboBox.setCurrentIndex(0)