prevent NoneType TB if fontattrs are not set

This commit is contained in:
Dimitur Kirov 2005-09-17 08:42:37 +00:00
parent 8e2dd60449
commit 159a4dad42

View file

@ -38,10 +38,11 @@ def get_theme_font_for_option(theme, option):
font_name = gajim.config.get_per('themes', theme, option) font_name = gajim.config.get_per('themes', theme, option)
font_desc = pango.FontDescription() font_desc = pango.FontDescription()
font_prop_str = gajim.config.get_per('themes', theme, option + 'attrs') font_prop_str = gajim.config.get_per('themes', theme, option + 'attrs')
if font_prop_str.find('B') != -1: if font_prop_str:
font_desc.set_weight(pango.WEIGHT_BOLD) if font_prop_str.find('B') != -1:
if font_prop_str.find('I') != -1: font_desc.set_weight(pango.WEIGHT_BOLD)
font_desc.set_style(pango.STYLE_ITALIC) if font_prop_str.find('I') != -1:
font_desc.set_style(pango.STYLE_ITALIC)
fd = pango.FontDescription(font_name) fd = pango.FontDescription(font_name)
fd.merge(font_desc, True) fd.merge(font_desc, True)
return fd.to_string() return fd.to_string()