From fdab393307601fbda47db903f77e4db1f8e941d3 Mon Sep 17 00:00:00 2001 From: JucaBlues Date: Thu, 29 May 2008 03:57:52 +0000 Subject: [PATCH] fix some crashes. Now I check for the existence of the d atrtibute before trying to use it --- src/display/nr-svgfonts.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/display/nr-svgfonts.cpp b/src/display/nr-svgfonts.cpp index 9b760c0bc..ccce7edc5 100644 --- a/src/display/nr-svgfonts.cpp +++ b/src/display/nr-svgfonts.cpp @@ -155,8 +155,10 @@ SvgFont::scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, } NArtBpath *bpath = NULL; - if (SP_IS_GLYPH(node)) bpath = sp_svg_read_path(((SPGlyph*)node)->d); - if (SP_IS_MISSING_GLYPH(node)) bpath = sp_svg_read_path(((SPMissingGlyph*)node)->d); + if (SP_IS_GLYPH(node) && ((SPGlyph*)node)->d) bpath = sp_svg_read_path(((SPGlyph*)node)->d); + if (SP_IS_MISSING_GLYPH(node) && ((SPMissingGlyph*)node)->d) bpath = sp_svg_read_path(((SPMissingGlyph*)node)->d); + + if (!bpath) return CAIRO_STATUS_SUCCESS; cairo_new_path(cr); -- 2.30.2