From cab013bc5d4da1c552a3afc4ea980645e9540f46 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 14 Aug 2018 15:27:25 +0200 Subject: Fix use of uninitialized variable in some cases, in recent bugfix. --- source/blender/editors/object/object_add.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 8fc2d419c3c..efc69c36cc3 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1621,7 +1621,7 @@ static int convert_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); Base *basen = NULL, *basact = NULL; - Object *ob, *ob1, *newob, *obact = CTX_data_active_object(C); + Object *ob, *ob1, *obact = CTX_data_active_object(C); DerivedMesh *dm; Curve *cu; Nurb *nu; @@ -1689,6 +1689,7 @@ static int convert_exec(bContext *C, wmOperator *op) } for (CollectionPointerLink *link = selected_editable_bases.first; link; link = link->next) { + Object *newob = NULL; Base *base = link->ptr.data; ob = base->object; @@ -1904,7 +1905,9 @@ static int convert_exec(bContext *C, wmOperator *op) } /* Ensure new object has consistent material data with its new obdata. */ - test_object_materials(bmain, newob, newob->data); + if (newob) { + test_object_materials(bmain, newob, newob->data); + } /* tag obdata if it was been changed */ -- cgit v1.2.3