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): """