diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-21 11:56:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-21 11:56:34 +0400 |
commit | 9c69a8028bac859bd5b429cdd4e7a652dd1d6d15 (patch) | |
tree | 84b9da636212ee665065acf8bd516d1e952181b0 /source/blender/editors/object/object_edit.c | |
parent | 0ebcc8557f9852dcf7165399a63b3e583895509b (diff) |
bugfix [#22091] Crashing on Add Shortcut
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index a1d2a6d734a..1ac84eb48ce 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -119,11 +119,15 @@ static bContext *C; static void error_libdata() {} -/* find the correct active object per context */ +/* find the correct active object per context + * note: context can be NULL when called from a enum with PROP_ENUM_NO_CONTEXT */ Object *ED_object_active_context(bContext *C) { - Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - if (!ob) ob= CTX_data_active_object(C); + Object *ob= NULL; + if(C) { + ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + if (!ob) ob= CTX_data_active_object(C); + } return ob; } |