From 26f144e1eca47cf3ddcad1cedb015d87c3ebfe10 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 27 Mar 2011 20:28:03 +0200 Subject: [PATCH] fix for ticket #142 --- openlp/core/lib/serviceitem.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 48a277633..2305f1102 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -406,24 +406,28 @@ class ServiceItem(object): def get_rendered_frame(self, row): """ - Returns the correct frame for a given list and - renders it if required. + Returns the correct frame for a given list and renders it if required. """ - if self.service_item_type == ServiceItemType.Text: - return self._display_frames[row][u'html'].split(u'\n')[0] - elif self.service_item_type == ServiceItemType.Image: - return self._raw_frames[row][u'title'] - else: - return self._raw_frames[row][u'image'] + try: + if self.service_item_type == ServiceItemType.Text: + frame = self._display_frames[row][u'html'].split(u'\n')[0] + elif self.service_item_type == ServiceItemType.Image: + frame = self._raw_frames[row][u'title'] + else: + frame = self._raw_frames[row][u'image'] + except IndexError: + frame = u'' + return frame def get_frame_title(self, row=0): """ Returns the title of the raw frame """ try: - return self._raw_frames[row][u'title'] + title = self._raw_frames[row][u'title'] except IndexError: - return u'' + title = u'' + return title def get_frame_path(self, row=0): """