do not try to save an empty list

This commit is contained in:
Andreas Preikschat 2013-07-19 18:38:43 +02:00
parent a1577df2be
commit 4eb1c3b4f1

View File

@ -592,6 +592,8 @@ class OpenLyrics(object):
found_tags.append(openlp_tag)
existing_tag_ids = [tag[u'start tag'] for tag in FormattingTags.get_html_tags()]
new_tags = [tag for tag in found_tags if tag[u'start tag'] not in existing_tag_ids]
# Do not save an empty list.
if new_tags:
FormattingTags.add_html_tags(new_tags)
FormattingTags.save_html_tags()