From b1c27d98a4976ebeb45be9bb75ea5b933e6d6866 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Sun, 10 Jun 2012 21:57:36 +0100 Subject: [PATCH] Fixes 1011286 Song Editor -> Edit All Crashes with out valid verse splitter Fixes: https://launchpad.net/bugs/1011286 --- openlp/plugins/songs/forms/editverseform.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 21285f39d..ad1acc06d 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -189,8 +189,14 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if self.hasSingleVerse: value = unicode(self.getVerse()[0]) else: - log.debug(unicode(self.getVerse()[0]).split(u'\n')) - value = unicode(self.getVerse()[0]).split(u'\n')[1] + lines = unicode(self.getVerse()[0]).split(u'\n') + log.debug(lines) + if len(lines) <= 1: + critical_error_message_box( + message=translate('SongsPlugin.EditSongForm', + 'Invalid entry, you need a verse splitter and some text.')) + return False + value = lines[1] if not value: lines = unicode(self.getVerse()[0]).split(u'\n') index = 2