From c37431c37889fed55de3b8c76a0dc0569f0fe42d Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 3 Feb 2013 19:37:58 +0100 Subject: fix crash Fixed bugs: - https://launchpad.net/bugs/1114243 (bzr r12094) --- src/widgets/font-selector.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/widgets/font-selector.cpp') 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; -- cgit v1.2.3 From 39e5510c9bed6a057db554fbcfd2e4b77aea1d76 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 5 Feb 2013 21:50:41 +0100 Subject: Supress Pango error message. (bzr r12103) --- src/widgets/font-selector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets/font-selector.cpp') diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index 0f0e27746..b0b4b5504 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -466,7 +466,9 @@ unsigned int sp_font_selector_get_best_style (font_instance *font, GList *list) tempFont = NULL; } - pango_font_description_unset_fields(bestMatchForFont, PANGO_FONT_MASK_SIZE); + if( bestMatchForFont != NULL ) { + pango_font_description_unset_fields(bestMatchForFont, PANGO_FONT_MASK_SIZE); + } list = list->next; -- cgit v1.2.3