fix for crash getting GROUP_OT_objects_remove's props without a context (own fault)
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2012 17:12:41 +0000 (17:12 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2012 17:12:41 +0000 (17:12 +0000)
source/blender/editors/object/object_group.c

index 48104c9274dcdf141d3880780297bf2517d020f7..c9851c6a0db4006e260fb62443f52f58312547c0 100644 (file)
@@ -237,7 +237,7 @@ static int group_objects_remove_exec(bContext *C, wmOperator *op)
 /* can be called with C == NULL */
 static EnumPropertyItem *group_objects_remove_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
 {
-       Object *ob = ED_object_context(C);
+       Object *ob;
        EnumPropertyItem *item = NULL, item_tmp = {0};
        int totitem = 0;
 
@@ -245,6 +245,8 @@ static EnumPropertyItem *group_objects_remove_itemf(bContext *C, PointerRNA *UNU
                return DummyRNA_NULL_items;
        }
 
+       ob = ED_object_context(C);
+
        /* check that the action exists */
        if (ob) {
                Group *group = NULL;