Fix a traceback when serviceitem type isn't set

This commit is contained in:
Tomas Groth 2017-05-05 20:47:19 +02:00
parent a39240badf
commit 7f64106acb

View File

@ -246,7 +246,8 @@ class ServiceItem(RegistryProperties):
self.renderer.set_item_theme(self.theme) self.renderer.set_item_theme(self.theme)
self.theme_data, self.main, self.footer = self.renderer.pre_render() self.theme_data, self.main, self.footer = self.renderer.pre_render()
if self.service_item_type == ServiceItemType.Text: if self.service_item_type == ServiceItemType.Text:
expand_chord_tags = self.name == 'songs' and Settings().value('songs/enable chords') expand_chord_tags = hasattr(self, 'name') and self.name == 'songs' and Settings().value(
'songs/enable chords')
log.debug('Formatting slides: {title}'.format(title=self.title)) log.debug('Formatting slides: {title}'.format(title=self.title))
# Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to # Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to
# the dict instead of rendering them again. # the dict instead of rendering them again.