Fixed a super-annoying bug where any newly imported Bibles would throw an exception.

This commit is contained in:
Raoul Snyman 2012-05-11 21:09:12 +02:00
parent 01ed8e4ed8
commit 8436d9d8c0

View File

@ -332,7 +332,10 @@ class BibleManager(object):
return None return None
language_selection = self.get_meta_data(bible, u'book_name_language') language_selection = self.get_meta_data(bible, u'book_name_language')
if language_selection: if language_selection:
language_selection = int(language_selection.value) try:
language_selection = int(language_selection.value)
except (ValueError, TypeError):
language_selection = 0
if language_selection is None or language_selection == -1: if language_selection is None or language_selection == -1:
language_selection = QtCore.QSettings().value( language_selection = QtCore.QSettings().value(
self.settingsSection + u'/bookname language', self.settingsSection + u'/bookname language',