diff options
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/font-selector.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index b17dcf470..0f0e27746 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -442,6 +442,10 @@ GtkWidget *sp_font_selector_new() */ unsigned int sp_font_selector_get_best_style (font_instance *font, GList *list) { + if ( !font || !list) { + return 0; + } + font_instance *tempFont = NULL; unsigned int currentStyleNumber = 0; unsigned int bestStyleNumber = 0; diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 9fdc1ea7b..f9921864c 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -238,7 +238,7 @@ static void sp_text_fontstyle_populate(GObject *tbl, font_instance *font=NULL) } // Select the style in the combo that best matches font - if (font) { + if (font && list) { unsigned int index = sp_font_selector_get_best_style(font, list); |
