Tim Bentley has proposed merging lp:~trb143/openlp/bug-884533 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #884533 in OpenLP: "openLP crashes completely when [---] is incorrectly 
used."
  https://bugs.launchpad.net/openlp/+bug/884533

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-884533/+merge/81066

Fix case where two [---] lines are next to each other.
-- 
https://code.launchpad.net/~trb143/openlp/bug-884533/+merge/81066
Your team OpenLP Core is requested to review the proposed merge of 
lp:~trb143/openlp/bug-884533 into lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2011-10-16 14:40:46 +0000
+++ openlp/core/lib/renderer.py	2011-11-02 19:09:27 +0000
@@ -229,6 +229,7 @@
         # Songs and Custom
         elif item.is_capable(ItemCapabilities.CanSoftBreak):
             pages = []
+            #
             if u'[---]' in text:
                 while True:
                     slides = text.split(u'\n[---]\n', 2)
@@ -250,7 +251,12 @@
                         # render the first virtual slide.
                         text_contains_break = u'[---]' in text
                         if text_contains_break:
-                            text_to_render, text = text.split(u'\n[---]\n', 1)
+                            try:
+                                text_to_render, text = \
+                                    text.split(u'\n[---]\n', 1)
+                            except:
+                                text_to_render = text.split(u'\n[---]\n')[0]
+                                text = u''
                         else:
                             text_to_render = text
                             text = u''

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to