From 1ce88e7a2a852446750c61ee1eb460a002fc0880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 15 Mar 2011 00:29:02 +0200 Subject: [PATCH] Prevent possible crash, if label field is empty in database. --- openlp/plugins/songs/forms/editsongform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 0d9121c45..069e1e4a8 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -269,6 +269,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if index is None: index = VerseType.Other verse[0][u'type'] = VerseType.Tags[index] + if verse[0][u'label'] == u'': + verse[0][u'label'] = u'1' verse_def = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def))