From 5f447101ddea3fffcfec86780ba912998842a8fa Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Mon, 10 Dec 2001 17:50:14 +0000 Subject: Don't crash if the text string is NULL. (text_draw_with_objects): Don't 2001-12-10 Jon Trowbridge * gal/e-text/e-text.c (text_width_with_objects): Don't crash if the text string is NULL. (text_draw_with_objects): Don't crash if the text string is NULL. (Fixes #16359) svn path=/trunk/; revision=14954 --- widgets/text/e-text.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'widgets/text') diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 8145ebfab6..4fc8437732 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -897,7 +897,7 @@ text_width_with_objects (ETextModel *model, EFont *font, EFontStyle style, const gchar *text, gint numbytes) { - return e_font_utf8_text_width (font, style, text, numbytes); + return text && *text ? e_font_utf8_text_width (font, style, text, numbytes) : 0; } static void @@ -909,6 +909,9 @@ text_draw_with_objects (ETextModel *model, const gchar *text, gint numbytes) { const gchar *c; + + if (text == NULL) + return; while (*text && numbytes > 0) { gint obj_num = -1; -- cgit