Fixed bug #763064: Empty line in first verse prevents saving a song.

bzr-revno: 1641
This commit is contained in:
Raoul Snyman 2011-06-14 18:39:36 +02:00
commit 487b007e49

View File

@ -185,7 +185,14 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
if self.hasSingleVerse: if self.hasSingleVerse:
value = unicode(self.getVerse()[0]) value = unicode(self.getVerse()[0])
else: else:
value = self.getVerse()[0].split(u'\n')[1] log.debug(unicode(self.getVerse()[0]).split(u'\n'))
value = unicode(self.getVerse()[0]).split(u'\n')[1]
if len(value) == 0:
lines = unicode(self.getVerse()[0]).split(u'\n')
index = 2
while index < len(lines) and len(value) == 0:
value = lines[index]
index += 1
if len(value) == 0: if len(value) == 0:
critical_error_message_box( critical_error_message_box(
message=translate('SongsPlugin.EditSongForm', message=translate('SongsPlugin.EditSongForm',