aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-12-11 01:50:14 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-12-11 01:50:14 +0800
commit5f447101ddea3fffcfec86780ba912998842a8fa (patch)
treeec36985f6b5904bf9c9c67a709103b3df3af5ed9
parentedf6873ade3d455f16be169a88c54819f32cea9c (diff)
downloadgsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar
gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar.gz
gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar.bz2
gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar.lz
gsoc2013-evolution-5f447101ddea3fffcfec86780ba912998842a8fa.tar.xz
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
-rw-r--r--widgets/text/e-text.c5
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;