diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-12-11 01:50:14 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-12-11 01:50:14 +0800 |
commit | 5f447101ddea3fffcfec86780ba912998842a8fa (patch) | |
tree | ec36985f6b5904bf9c9c67a709103b3df3af5ed9 /widgets/text | |
parent | edf6873ade3d455f16be169a88c54819f32cea9c (diff) | |
download | gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar.gz gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar.zst gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.zip |
Don't crash if the text string is NULL. (text_draw_with_objects): Don't
2001-12-10 Jon Trowbridge <trow@ximian.com>
* 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
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-text.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |