From 00afa5900486dd95a43d1415014c43d3544be720 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Nov 2011 01:05:26 +0000 Subject: [PATCH] fix for crash adding empty object --- source/blender/editors/object/object_add.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index bcd8b8903e7..f1bc63aa746 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -326,7 +326,9 @@ Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, int en DAG_id_type_tag(bmain, ID_OB); DAG_scene_sort(bmain, scene); - ED_render_id_flush_update(bmain, ob->data); + if (ob->data) { + ED_render_id_flush_update(bmain, ob->data); + } if(enter_editmode) ED_object_enter_editmode(C, EM_IGNORE_LAYER); @@ -1809,7 +1811,9 @@ Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag set_sca_new_poins_ob(ob); DAG_scene_sort(bmain, scene); - ED_render_id_flush_update(bmain, ob->data); + if (ob->data) { + ED_render_id_flush_update(bmain, ob->data); + } return basen; }