From 98486bf95b69b6415324af2f0561454e9691c8a7 Mon Sep 17 00:00:00 2001 From: Felipe Correa da Silva Sanches Date: Wed, 10 Feb 2010 17:53:10 -0200 Subject: [PATCH] check if some pointers are not null --- examples/testSVG.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/testSVG.c b/examples/testSVG.c index 8881f10..bfa6032 100644 --- a/examples/testSVG.c +++ b/examples/testSVG.c @@ -192,10 +192,20 @@ output_object(Dwg_Object* obj){ void output_BLOCK_HEADER(Dwg_Object_Ref* ref) { Dwg_Object* obj; - Dwg_Object_BLOCK_HEADER* hdr; - hdr = ref->obj->tio.object->tio.BLOCK_HEADER; + if (!ref) + { + fprintf(stderr, "Found null object reference. Could not output an SVG symbol for this BLOCK_HEADER\n"); + return; + } + if (!ref->obj) + { + fprintf(stderr, "Found null ref->obj\n"); + return; + } + + hdr = ref->obj->tio.object->tio.BLOCK_HEADER; printf( "\t\n\t\t\n", ref->absolute_ref, hdr->entry_name); -- 1.6.0.4